Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Month Order

Hi Friends

I have attached a QVW file and the supporting work sheet. I want your help to do the following

1.Create master Calender with Year_Month as field

2. When I select an Year_Month that particular month should be the 1st Column of the Pivot table other months  after that

Eg : If I select 2013_05 as Year_Month my pivot table should look like as follows

YEARMONTHMAYJUNJULAUGSEPOCTNOVDECJANFEBMARAPR
201315,332,7994,778,4755,820,4514,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,139,5206,129,3304,060,620
201325,332,7994,778,4755,820,4514,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,225,0416,129,3304,060,620
201335,332,7994,778,4755,820,4514,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,225,0415,436,1994,060,620
201345,332,7994,778,4755,820,4514,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
201355,017,3814,778,4755,820,4514,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
201365,017,3813,978,7195,820,4514,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
201375,017,3813,978,7194,813,1784,327,2084,492,2975,708,3825,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
201385,017,3813,978,7194,813,1784,772,9334,492,2975,708,3825,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
201395,017,3813,978,7194,813,1784,772,9335,844,2025,708,3825,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
2013105,017,3813,978,7194,813,1784,772,9335,844,2024,616,7795,472,0655,573,4704,122,2705,225,0415,436,1993,911,853
2013115,017,3813,978,7194,813,1784,772,9335,844,2024,616,7794,843,3275,573,4704,122,2705,225,0415,436,1993,911,853
2013125,017,3813,978,7194,813,1784,772,9335,844,2024,616,7794,843,3273,715,3684,122,2705,225,0415,436,1993,911,853
2013Total61,470,24551,743,404############59,315,184######64,407,304######49,467,24262,614,97366,620,65247,388,537

Pls help me to solve the issue. If You can write the script in my document so much the better

Thanks in advance

3 Replies
Not applicable

Hello,

i'am not sure what are your real source data and what it was done with those data in your excel.

But if your excel crosstable is your source, you may do it for example this way.

Let me know if you like it and if you need more help

regads

Darek

its_anandrjs

As to see your data from attached excel file you have to load a cross table for this because there is no common month field. If month field is there it will more easy but as see your excel data you need to load a cross table and make a common field and from another table create a MonthYear field for calculation.

See the attached load example and load your table according to that.

Tab1:

CrossTable(MONTHS, Data, 2)

LOAD YEAR,

     MONTH,

     JAN,

     FEB,

     MAR,

     APR,

     MAY,

     JUN,

     JUL,

     AUG,

     SEP,

     OCT,

     NOV,

     DEC

FROM

(biff, embedded labels, table is Sheet1$);

Data:

LOAD *,

if(MONTHS='JAN',1,

if(MONTHS='FEB',2,

if(MONTHS='MAR',3,

if(MONTHS='APR',4,

if(MONTHS='MAY',5,

if(MONTHS='JUN',6,

if(MONTHS='JUL',7,

if(MONTHS='AUG',8,

if(MONTHS='SEP',9,

if(MONTHS='OCT',10,

if(MONTHS='NOV',11,

if(MONTHS='DEC',12)))))))))))) AS NumMonth,

MonthName(MakeDate(YEAR,MONTH)) as MonthYear,

Month(MakeDate(YEAR,MONTH)) as NewMonth

Resident Tab1;

DROP Table Tab1;

EXIT Script;

Change excel load as your excel location in your system

And after loading of table take a Pivot table

Dimension1 :- YEAR

Dimension2:- NumMonth

Dimension3:- NewMonth

Expression:- SUM({<YEAR=,MonthYear = {'>=$(=Max(MonthYear))'}>} Data)

See the attached snapshot

MonthOrder.png

preminqlik
Specialist II
Specialist II

Hi ,

Find attachment