Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a month which are text
Jan
Feb
Mar
Oct
Need to convert in to months MM in date format
Try this in the script:
Month(Date#(MonthField, 'MMM')) as MonthField
Where Month is dual and will be both Text and Number.
i want in MM not in MMM
which is not happening...
Try this:
Num(Month(Date#(MonthField, 'MMM'))) as MonthField
You can also try this:
Match(MonthField, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') as MonthField
you have month column separately I will suggest use Mapping load
and then use ApplyMap() function to replace Jan with 01,
Thanks
BKC
Hi Saumya,
Try like this
LOAd
*,
Date(Date#(MonthField, 'MMM'), 'MM') as MonthField
FROM DataSource;
OR
LOAd
*,
Match(MonthField, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') as MonthField
FROM DataSource;
OR
by using Mapping table.
Hope this helps you.
Regards,
Jagan.
Try Some thing like this,
Month(Date(Date#(Field name,'MMM'),'MM')) as Temp
I just had the same problem. num(MonthField,'00') solves the problem within QlikView/Qlik Sense but the problem is that when I export to excel, the entry in the cell is '0' even though it displays '00'. I added the Text() function and that worked. Now it is ok in Qlik Sense and also after excel export. Final syntax is text(num(MonthField,'00'))