Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to extract month number from name in expression(measure).
for example if month name is March it should return me 3. Kindly suggest me a function for that in qliksense.
The format of Qlikview and Qliksense are similar. May be this?
Num(Month(FieldName)) as MonthNum
Num(Month(Date#(MonthText,'MMM'))) // If months are short names like, Jan, ...
Or,
Num(Month(Date#(MonthText,'MMMM'))) // if months are full names like, January, ....
The other way would be is to create a inline table for 12 month with the value and you could map that with number
And if you have created the month field in the script using month() already, you could simply use num() to get number like:
Num(Month)
Hi Neha,
You can use this expression
Mod(Month(DateField) - $(vFiscalYearStartMonth),12)+1
where vFiscalYearStartMonth is an variable in my case i have assigned it with 4 you can assign according to your requirement
Like this???
Load
Date,
Num(Month(Date)) AS MonthNumber
....
Hi Tresesco,
I could retrieve month number from date column but i need both the numbers
Eg: "20190101" is my date format if I use num(month(fieldname)) , I am getting output as "1" but my requirement is "01"
how do i get that?
Thanks in advance
Regards,
Puneet
If you need two-digit output, try using number formatting, like:
num(month(fieldname), '00')
Thanks Tresesco
I got the correct output.
Regards,
Puneet Agarwal