Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I have a problem in my application with a field. The values in this field are uneven. how can i fix it. i want to make all the values in the format year_Month. below is the image.
Thanks
Mark
Do you have 2 possible formats? Then, when loading the different date fields in your script, test for the presence of an underscore. If it isn't there, format the purely numerical value with date(date#(NumericalDateValue, 'YYYYMM01'), 'YYYY_MM') or something.
Peter
Try like this
Date(Date,'DD/MM/YYYY')
or
use in script
Set DataFormat='DD/MM/YYY'
purgechar(field,'_')
Use in script or list box expression
if you have mixed format you can use the alt function
M:
LOAD YM, date(alt(date#(YM, 'YYYY_MM'), Date#(YM, 'YYYYMM')), 'YYYY_MM') as NewYM;
LOAD * INLINE [
YM
2014_01
2014_02
201403
201404
];
Try this in script
date(Date#(PurgeChar(Datefield,'_'),'YYYYMM'),'YYYYMM') AS Date
or
date(PurgeChar(Datefield,'_'),'YYYYMM') AS Date
hi try this
date(date#(replace(TransDate,'_',null()),'YYYYMM'),'YYYYMM') as NEWDate