How to Convert Datetime value from lookup activity output to only a Date value into Set variable activity using AzureDataFactory - azure-data-factory

Can you please help me in formatting the Lookupactivity Output value from Datetime to Date type and pass into set_variable activity.
Step 1:
I am using a query in Lookup activity as SELECT CAST(MAX([DWHModifiedDate]) AS DATE) AS DWHModifiedDate FROM [Schema].[TableName]
The output from lookup activity is like "DWHModifiedDate": "2022-11-18T00:00:00Z"
Step 2: Now i added a Set_variable activity and i want to store only the date from Lookup activity output for example the variable value should be only "2022-11-18".
Can you please help how to achieve this.

You can also just try to extract the required date directly using #split() function. The following is a sample and the output of look up activity looks as shown below:
You can split on T and extract the 0th index to get the required output as well (since the date is already in the format of yyyy-MM-dd).
#split(activity('Lookup1').output.firstRow.dt,'T')[0]
This would give the required output like yyyy-MM-dd format.
Using formatDateTime also gives desired output.

#formatDateTime(activity('lookupactivity').output.firstRow.DWHModifiedDate,'yyyy-MM-dd')

Related

ADF toTimetsamp() function not including 'T' in date pattern

I want to convert string to timestamp (required for further processing). Date format I require is "yyyy-MM-dd'T'HH:mm:ss". As you can observe in below screenshot, 'T' is missing in the output. Is there any way to include 'T' in the output?
Thanks!
As per Microsoft official document, toTimestamp doesn't inculude T in the output.
toTimestamp('2016-12-31T00:12:00', 'yyyy-MM-dd\'T\'HH:mm:ss', 'PST') -> toTimestamp('2016-12-31 00:12:00')
Refer toTimestamp() to know more.
You can use another approach. Go to the Schema of the Sink and change the column type to DateTime. In Format column mention the format as per your requirement as mentioned below.

Date format in SSRS Expression

I am trying to change the date format for one of my field to dd/MM/yyyy but every time I used the below expression I get dd/MM/yyyy as the value in the cell instead of changing the format.
The data source that I am using is Teradata.
Expression used: =Format(FormatDateTime(Fields!DATE.Value, DateFormat.ShortDate),"dd/MM/yyyy")
Can some one help me with where am I going wrong.
Any help would be appreciated.
The FormatDateTime function returns a string instead of a date. When the FORMAT function tries to format it, it doesn't find a date field so it returns the characters in the format.
If your field is a date, you should be able to format the field without conversion:
=Format(Fields!DATE.Value,"dd/MM/yyyy")
If it does need to be converted first, try using the CDATE function:
=Format(CDATE(Fields!DATE.Value),"dd/MM/yyyy")

Tableau Dashboard Default set to Yesterday by using Date Parameter

I have created daily dashboard which shows the data for single date selected from DATE PARAMETER (with ALL value). Which is OK for me that I can see the data for any date I want.
But the problem is when I open my dashboard it is showing data for date which I selected in date parameter while publishing the Dashboard to Server/Online and Instead of that I want set it default to Yesterday.
i.e. when I open my dashboard first time it should show yesterday's data and also there should option to change date as well to see another date data.
Can we achieve this using DATE PARAMETER (with ALL values)? If it is not possible then is there any other way?
Please Help!
Use a relative date filter instead of a parameter. Just be sure to save and publish the workbook with Yesterday as the relative date value.
1, Create a calculation field d_yesterday, formula is TODAY()-1
2, Create a parameter, data type is Date, value when workbook opens set to d_yesterday
3, use the Date parameter in other calculations fields, or insert parameter into custom SQL query.

Tableau - Dynamic Parameter Reference

I have a series of parameters in Tableau corresponding to every month in the coming years. The parameter names are all in the format Name - YYYY-MM-DD where YYYY-MM-DD is the corresponding beginning of the month. I would like to reference the parameter using the current month value (e.g. 2017-11-01).
How can I reference a parameter using something like the following:
["Name "+DATEFUNCTION()]
where DATEFUNCTION() will create the date in the appropriate format. However, this clearly does not work.
Referencing parameter name dynamically is not possible.
You can either try to implement your logic of pulling data out of parameters as a single calculated field or use a secondary datasource containing Date,Value,DummyLinkToPrimary fields and filter it on date.

How can select future date randomly without csv in jmeter from the list

I have this list of date. i need to select only any future date from the list without csv. how can i do this?
Image of list of date
Option 1: HTML Link Parser - see Poll Example
Option 2: Combination of XPath Extractor and __Random() function
You can use ${__time(dd,)} to get current date. This date will be in String format. Lets store this to variable name date
Convert this date in number with java script function parseInt in BSF pre processor. Lets store this to variable name date_int
Now with random function ${__Random(${date_int},30,)}, you will get random number between current date and 30th of the month.
Use this random number for selecting index of your date list.
code is here
This is working here.
I have putted the myDay,myMonth,myYear variables as parameter.