Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
does anyone now if I can create out of a number a month name??
example:
8 -> Aug
9 -> Sep
please help me
regards,
MT
Hi MT,
Did you try this threads yet?
http://community.qlik.com/message/224231
http://community.qlik.com/thread/49830
Regards,
Sokkorn
Hi
Or (assuming MonthNum contains a number such as 8 for Aug
Month(MakeDate(2000, MonthNum, 1)) As Month
Regards
Jonathan
Try this
FOR i=1 to 12
LOAD Month(MakeDate(Year(Today()),$(i),1)) as Month AutoGenerate(1);
NEXT
FOR i=1 to 31
LOAD $(i) as Day AutoGenerate(1);
NEXT
You can also concatenate the Month or Day field with your original table month & day fileds. By using Concatenate(Table1) Load ...
Cheers!
Jagan
In your QV script, you can set your Month Names like this...
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
based on which, you can call them in your script below as ... Month(xyz) as "Month Name"
Month
(MakeDate(year(Year,MonthNo))
In your fact table or where you have field MonthNum use Mapping table and map the Monthname in the table See the load script
MapTable:
Mapping LOAD * INLINE [
MonthNum, MonthName
1, Jan
2, Feb
3, Mar
4, Apr
5, May
6, Jun
7, Jul
8, Aug
9, Sep
10, Oct
11, Nov
12, Dec
];
FactTable:
LOAD *, ApplyMap('MapTable',MonthNum) as MonthName Inline [
MonthNum
1
2
3
4
5
6
7
8
9
10
11
12
];
Or
FactTable:
LOAD
*, ApplyMap('MapTable',MonthNum) as MonName
From Location;
Hi,
Try like this
LOAD
*,
Pick(MonthNumber, 'Jan', 'Feb', 'Mar', 'Apr', 'May','Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec') AS MonthName
From DataSource;
Regards,
Jagan.
After load a table as mapping table then if you have problem to get the correct monthname then try to load your map table differently see the load script
MapTable:
Mapping LOAD
RowNo() as MonthNum,
Month(AddMonths((Today()),RowNo()+7)) as MonName
AutoGenerate 12;
FactTable:
LOAD *, ApplyMap('MapTable',MonthNum) as MonthName
Inline [
MonthNum
1
2
3
4
5
6
7
8
9
10
11
12
];
Regards
Anand
hi try this
Load *,
month(Date#(field,'M')) as Monthname
from path;