Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
PFA the qlikview app. I want the dimension YearMonth as Jan-2017, Feb-2017 from 12017, 22017 and so on.
Thanks for your help!
But buddy im getting it in that format. Should i use len() or other string functions?
Try with :
Load *,
if(len(YearMonth)=5, date(date#(YearMonth,'MYYYY'),'MMM-YYYY'), date(date#(YearMonth,'MMYYYY'),'MMM-YYYY')) as newfield
Resident Table;
Should i use len() or other string functions?
Use if condition with len function Like Jean said
if(len(YearMonth)=5, date(date#(YearMonth,'MYYYY'),'MMM-YYYY'), date(date#(YearMonth,'MMYYYY'),'MMM-YYYY')) as Newfield
You are right. Try this:
Date(Date#(Num(YearMonth,'000000'),'MMYYYY'),'MMM-YYYY') as "Month Year"
Another solution is:
Table:
LOAD
Date(MakeDate(right(YearMonth,4),left(YearMonth,Len(YearMonth)-4)),'MMM YYYY') as YearMonth
;
LOAD * INLINE [
YearMonth
12017
22017
32017
42017
52017
62017
72017
82017
92017
102017
112017
122017
];