Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
New to Qlikview... please can someone tell me how I can convert numbers to months to that 1 is displayed as Jan, 2 as Feb etc. I have a listbox with the numbers 1 - 12 in - so how can I convert the numbers to text and still retain the functionality?
Thanks,
markp3rry.
Hi,
Try like this in script
LOAD
*,
Pick(monthnum, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') AS Month
FROM Data;
Regards,
Jagan.
Date# is how Qlikview knows what "1" or "2" means... Then use the "Month" function around it. No hard coding years needed.
Month(Date#([FIELD],'M')) as MONTH
Hi Mark,
if script like below
load * inline [
Mon
1
2
3
4
5
6
7
8
9
10
11
12
];
then simply write the expression like below
=if(Mon=1,'Jan',
if(Mon=2,'Feb')) up to 12 months
Hi pratyush,
I have used the above script but I am not getting the Month names in order like jan, feb, mar...
i am getting in alphabetical order like apr, aug, dec, feb....
Can you please suggest me how can I get that in this order. jan, feb, mar...
I should not add inline table
Thanks in Advance
You need to create dual values. The simplest way is to use
Month(MakeDate(2018,Month))
but you can also modify Pratyush' script to
=if(Month=1,Dual('jan',1),
if(Month=2,Dual('Feb',2),
if(Month=3,Dual('March',3)
...
HIC