Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

dhavalvyas
New Contributor II

Monthname from Fiscal Calendar

Hi,

Following is my Calendar from which I want Month Name.How to Retrive Month Name from It.

left join (April)

LOAD * INLINE [

MONTH_NUM,Month

4, Apr

5, May

6, Jun

7, Jul

8, Aug

9, Sep

10, Oct

11, Nov

12, Dec

1, Jan

2, Feb

3, Mar

];

GDP_1:

load *,

MakeDate(Year,MONTH_NUM,1) as GDPDT

//'Q' & Ceil(NUM(MONTH_NUM)) AS GDPQuarter,

//'Q' & ceil(month(MakeDate(Year, MONTH_NUM,1))/3) as [GDPDT Quarter]

Resident April;

drop table April;

GDP_Final:

Load *,

//Year(GDPDT) AS [GDP Year],

right(yearname(GDPDT,0,4),4) as [GDP FYear],

//Month(GDPDT) AS [GDP Month],

if(num(month(GDPDT))<=3,(num(month(GDPDT))+9),(num(month(GDPDT))-3)) AS [GDP MonthNum],

Day(GDPDT) AS [GDP Day],

'Q' & Ceil(NUM(if(num(month(GDPDT))<=3,(num(month(GDPDT))+9),(num(month(GDPDT))-3)))/3) AS [GDPDT Quarter]

RESIDENT GDP_1;

DROP TABLE GDP_1;

8 Replies
passionate
Valued Contributor

Re: Monthname from Fiscal Calendar

Please post sample Application

dhavalvyas
New Contributor II

Re: Monthname from Fiscal Calendar

The Script I have wrote for calendar I already attached,can you help me out from that cause I have not Application right now..

So how to Get Month Name from Above Script...?

thiago_justen
Valued Contributor III

Re: Monthname from Fiscal Calendar

To get month name try this out:

Date (GDPDT,'MMM') as MonthName

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
sasiparupudi1
Honored Contributor III

Re: Monthname from Fiscal Calendar

Isnt it simply selecting the field in your load statement? or please  post a sample

GDP_1:

load *,

MakeDate(Year,MONTH_NUM,1) as GDPDT

Month,

//'Q' & Ceil(NUM(MONTH_NUM)) AS GDPQuarter,

//'Q' & ceil(month(MakeDate(Year, MONTH_NUM,1))/3) as [GDPDT Quarter]

Resident April;

drop table April;

GDP_Final:

Load *,

//Year(GDPDT) AS [GDP Year],

right(yearname(GDPDT,0,4),4) as [GDP FYear],

Month,

//Month(GDPDT) AS [GDP Month],

if(num(month(GDPDT))<=3,(num(month(GDPDT))+9),(num(month(GDPDT))-3)) AS [GDP MonthNum],

Day(GDPDT) AS [GDP Day],

'Q' & Ceil(NUM(if(num(month(GDPDT))<=3,(num(month(GDPDT))+9),(num(month(GDPDT))-3)))/3) AS [GDPDT Quarter]

RESIDENT GDP_1;

DROP TABLE GDP_1;

dhavalvyas
New Contributor II

Re: Monthname from Fiscal Calendar

Hi Thiago I got output as Apr,May,Jun....so on but My Date is of Two Years i.e. 2017 and 2018 and I want Output as Apr 2017,May 2017...Apr 2018,May 2018...so on

So how it is Possible...?

Thanks in Advanced..

thiago_justen
Valued Contributor III

Re: Monthname from Fiscal Calendar

Yes, it's.

Date (GDPDT,'MMM') & ' ' & Year (GDPDT) as MonthYear

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
sasiparupudi1
Honored Contributor III

Re: Monthname from Fiscal Calendar

Date (GDPDT,'MMM YYYY') as MonthYear

dhavalvyas
New Contributor II

Re: Monthname from Fiscal Calendar

Hi Sasidhar it is working but is gives output  like 01/03/2017,01/02/2017 but I want output as Apr 2017,May 2017..

Community Browser