Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I have a small problem to convert a list of numbers into short month names, the question is as follows:
can we convert a the list of numbers from 1 to 12 in short month names such Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov, and Dec in qlikview.
Thanks in advance.
Rajiv
You probably already have variable MonthNames defined (check out Number Interpretion Variables in Help), so you could also retrieve the short names by using (in script or forntend)
subfield('$(MonthNames)',';',MonthID)
where MonthID needs to be replaced by your field that holds the numbers 1-12 or literals.
Load * inline [
Month,MonthNo
Jan,1
Feb,2
Mar,3
Apr,4
May,5
Jun,6
Jul,7
Aug,8
Sep,9
Oct,10
Nov,11
Dec,12
];
link MonthNo with your Monthnumber
hope this helps
Map1:
Mapping
LOAD * INLINE [
Mno, MName
1, Jan
2, Feb
3, Mar
4, Apr
5, May
6, Jun
7, Jul
8, Aug
9, Sep
10, Oct
11, Nov
12, Dec
];
LOAD *,
ApplyMap('Map1',Month(DateField)*1) as MonthName
From
Table;
Hope it helps you...
You probably already have variable MonthNames defined (check out Number Interpretion Variables in Help), so you could also retrieve the short names by using (in script or forntend)
subfield('$(MonthNames)',';',MonthID)
where MonthID needs to be replaced by your field that holds the numbers 1-12 or literals.
Hello everyone,
the applyMap works. However swuehl, your suggestion about subfield is indeed more helpful as i do have the variable MonthNames defined. So no need to do a load inline etc to apply map..
thanks mate..
Rajiv