Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am working on an application where I need to change the date format according to the value the user selects.
Ex: Suppose for a region field, if user selects US, the date format should be MM/DD/YYYY and if user selects UK, the format should be DD/MM/YYYY. (only for example purpose)
I tried to use if condition in script; but it's not working.
Could you please help me for the same?
And is it possible to do the same in table box or straight table, where according to the region the date in the respective format be shown?
Thank you!
Use this,
ABC:
Load * Inline [
A,b
US,02/03/2019
UK,02/17/2019
US,02/19/2019
];
AA:
load
A,
b,
If(A='US',Date(b,'MM/DD/YYYY'),Date(b,'DD/MM/YYYY')) as new_date
Resident ABC;
drop Table ABC;
Try this,
=if(yourField='US',date(today(),'MM/DD/YYYY'), if(yourField='UK',date(today(),'DD/MM/YYYY')))