Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help showing the data in pivot table

Hi All,

I need a help from you guys. I have attached the qlikview document and the image. I want the data to be show like the image. How can i do this?.

-Raghu.

14 Replies
Not applicable
Author

here is the image

-Raghu.

Not applicable
Author

Hi Raghu,

Please check attached file. It may useful for you.

Best Regards,

Not applicable
Author

Hi Asim,

I tried that one, but requirement is show only the current month and the last month values.

Is there any other way to show the values.

Thanks,

Raghu.

Not applicable
Author

Hi Raghu,

MTD is not supported by Qlikview. So you should create a master calendar as below:

Then you should change the dimension of your pivot table as below:

IF(cal_mtd_current=1,Month(date))

and
IF(cal_mtd_previous=1,Month(date))


Range:
LOAD
min(Datefield) as startdate,
max(Datefield) as enddate
resident Sales;


//Peek out the values for later use
let vStart = peek('startdate',-1,'Range')-1;
let vEnd = peek('enddate',-1,'Range');
let vRange = $(vEnd) - $(vStart);
//Remove Range table as no longer needed
Drop table Range;
//Generate a table with a row per date between the range above
Date:
Load
$(vStart)+recno() as Date
autogenerate $(vRange);
//Calculate the Parts you need to examine
Calendar:
load
//Date as MyDate,
date(Date,'DD.MM.YYYY') as Cal_FullDate,
date(Date,'DD.MM.YYYY') as Datefield,
Year(Date) as Cal_Year,
'Q'&ceil(Month(Date)/3) AS Cal_Quarter,
Month(Date)&'-'&right(year(Date),4) as Cal_MonthYear,
Month(Date) as Cal_Month,
Day(Date) as Cal_Day,
Week(Date) as Cal_Week,
Weekday(Date) as Cal_WeekDay,
YearToDate(Date , 0, 1, $(v_date))*-1 AS Cal_YTD_Current,
YearToDate(Date , -1, 1, $(v_date))*-1 AS Cal_YTD_Previous,
YearToDate(Date , 0, Month('$(v_date)'))*-1 AS Cal_MTD_Current,
YearToDate(Date , -1, Month('$(v_date)'))*-1 AS Cal_MTD_Previous

Resident Date;
//Tidy up
Drop table Date;








Not applicable
Author

hi you can do Month-1 it will work

Not applicable
Author

this will help

=if((Month(date) = month(today())),Month(date), if((month(date)=month(today()))-1,month(Month(date)-1)))



Not applicable
Author

Hi

AtifAhmad -- I had given your statement but it showing the 3 months. Can you look the attached one and let me know what is wrong in that.

Asim -- I gave the code, and same expression i used but data not showing. can you check the attached file and tell me what is wrong in that. Please

-Raghu.

Not applicable
Author

Hi Raghu,

Please check attached file. I think that will help you.

Kind Regards,

Asim Akin

Not applicable
Author

Raghu, try the attcahced file i have fixed it