Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am facing a strange issue.
When I use the below expression for comparing the date format, it returns -1 even though the date format doesn't match.
IsNum((Date#('Mar 2015','MMMM YYYY'))) ,
When I use the below expression, it returns 0 as expected.
=IsNum((Date#('201501','YYYY-MM')))
It is just that this expression is not able to compare date in MMM and MMMM Format.
Is there anything wrong with the expression i am using?
Can we use a generic expression for comparing all the date formats?
Thanks,
Asma
Try this...
=IsNum((Date#('Mar 2015','MON YYYY')))
try IsNum((Date#('Mar 2015','MMM YYYY'))) with 3 M instead of 4
Qlikview seems to treat MMM and MMMM interchangeably:
Date#('Mar 2015','MMMM YYYY')
Date#('March 2015','MMMM YYYY')
Date#('Mar 2015','MMM YYYY')
Date#('Mar 2015','MMMM YYYY')
all produce the same output. This returns null:
Date#('Mar 2015','MM YYYY')
Irrespective of using 3Ms or 4Ms, the expression is always returning -1
The expression =Date#('Mar 2015','MM YYYY') is returning Mar 2015
Hi Asma,
Use Alt() function
From Guide :
Alt( date#( dat , 'YYYY/MM/DD' ),
date#( dat , 'MM/DD/YYYY' ),
date#( dat , 'MM/DD/YY' ),
'No valid date' )
Regards,
Antonio