You can translate the question and the replies:

Create a custom date for the output file name in denodo scheduler

Hi, In scheduler output file name, i'm looking to get the last day of the previous month's date. Currently the only solution I've found is to use the DOCUMENT_FIELD_NAME variable which however is not suitable for my case because the data would be printed in the csv file. So how can i get the last day of the previous month's date as output file name. Or how to create a custom exporter for it? Share the file if possible. Thanks in advance
user
31-01-2024 08:14:51 -0500
code

3 Answers

Hi, From my understanding, I believe that below is your requirement. For example, if 2024-02-05 is the date, then the previous month's date is 2024-01-05 and if you want to get the last day of 2024-01-05, then 31 is the last day of 2024-01-05. If my above understanding is correct, then you could use the DOCUMENT_FIELD_NAME variable which takes the value of a field from the exported document. In order to do this, you can include a date field which provides the last day of the previous month's date in your query by executing the query in the Extraction Section as: `Select <column_names>,getday(LASTDAYOFMONTH(addmonth(<your_date_column>,-1))) as last_day from <view_name>` and use the field name ‘last_day’ in the output file path of the Exporter section i.e, as DOCUMENT_FIELD_NAME variable like: `@{field:<DOCUMENT_FIELD_NAME>,inputDateFormat: <input_format>,outputDateFormat: <output_format>}` where <DOCUMENT_FIELD_NAME> can be replaced as last_day column. For more information, you can refer to [Postprocessing Section (Exporters)](https://community.denodo.com/docs/html/browse/latest/en/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/postprocessing_section_exporters) section of Scheduler Administration Guide. Hope this helps!
Denodo Team
05-02-2024 02:25:15 -0500
code
HI, thanks so much for the reply. As previously specified, the use of the DOCUMENT_FIELD_NAME variable to value the name of the output file is not for me as the output csv file will necessarily have a 'last_day' field printed inside it and, given that the file in question it must be interpreted by a software and not by a person, it cannot have additional fields inside it. Is there a different solution? Thanks in advance
user
05-02-2024 03:40:52 -0500
Hi, I understand your use case that you don’t want to have an additional field in the exported csv file. However, this `@{field:<DOCUMENT_FIELD_NAME>}` when mentioned in the Output file parameter in the Scheduler’s Exporter’s section, will mandatorily include an additional field in the exported csv file. So, if you want to customize the output filename of exported csv file, then you could try developing a [Custom Exporter](https://community.denodo.com/docs/html/browse/latest/en/scheduler/administration/developer_api/extensions_plugins/exporters) using Denodo4E, an Eclipse plug-in (located in the <Denodo_home>/tools/denodo4e folder), which can be build to generate the file name with last day of the previous month's date. You could also refer to [Extensions (Plugins)](https://community.denodo.com/docs/html/browse/latest/en/scheduler/administration/developer_api/extensions_plugins/extensions_plugins) section of Scheduler Administration Guide. Further, If you have valid support access, then I suggest you to open a new Support case at [Denodo Support Site](https://support.denodo.com/) where we could assist you more on this. Hope this helps!
Denodo Team
12-02-2024 01:34:34 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here