Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Is it possible to compare the date time format of a field?
e.g. if datetime format is in DD-MM-YYY hh:mm:ss TT, then 'Y' else 'N' in the field Check should be created.
Thanks,
Asma
You might be able to do this:
If(IsNum(Num(Date#(YourDateField, 'DD-MM-YYY hh:mm:ss tt'))), 'Y', 'N')
Best,
Sunny
=If(IsNum(Timestamp#('01-01-2010 01:10:10 AM','DD-MM-YYYY hh:mm:ss TT')),'Y','N')
Hi,
Try like this
Arriving a flag in script will have better performance in front end.
LOAD
*,
If(TimeStamp#(DateFieldName, 'DD-MM-YYY hh:mm:ss TT'), 'Y', 'N') AS Flag
FROM DataSource;
Now use this flag in set analysis like below
Count({<Flag={'Y'}>} SomeDimension)
Regards,
Jagan.
Hi Asma,
You can check the Date Format or Date-Time Format with the help of Alt function.
Please refer to attached image for detail:
Thanks & Regards
Prince Anand
Is it possible to get the DateFieldName from a variable?
e.g. If I use
let vColumnName=FieldName(1,'Test') as [Column Names]
vColumnName would store the column name.
Now can I use the below expression for checking the datetime format
If(TimeStamp#(vColumnName, 'DD-MM-YYY hh:mm:ss TT'), 'Y', 'N') AS Flag
Yes Asma You can get the column name by using fieldname function and store it in a variable like show below:
set vStartDate=makedate(2015,05);
Calendar:
load date($(vStartDate)+RecNo()-1,'DD-MM-YYYY') as Date
AutoGenerate makedate(2015,05,15)-$(vStartDate)+1;
let vColName=fieldname(1,'Calendar');
and then use the alt function as describe above.
Thanks & Regards
Prince Anand
Hi,
Try like this
If(TimeStamp#($(vColumnName), 'DD-MM-YYY hh:mm:ss TT'), 'Y', 'N') AS Flag
Regards,
jagan.
The above expression is not working.
It always returns N
Can you post sample input