Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Last 5 rows in Pivot Table

Hi All,

I have a pivot table which is showing value by Quarter.

I want to show last 5 quarter.

My Expression is like below for dimension:

=If(CstFiscalYearQuarterConcat>= Max( TOTAL CstFiscalYearQuarterConcat,5), CstFiscalYearQuarterConcat).

It is showing perfect.

Now user want see Quarter as Year-Quarter. And it would be :

CstFiscalYear & '-' & CstFiscalQuarterNum

These concated field is not working in the above syntax. I feel this is not a number, that might be the reason.

Could anyone please help me out.

Thanks,

Sarif

1 Solution

Accepted Solutions
Kushal_Chawda

create the numeric quarter value using DUAL function like below in script

=dual(CstFiscalYear & '-' & CstFiscalQuarterNum,CstFiscalYear&CstFiscalQuarterNum) as CstFiscalYearQuarterConcat



Now you can use condition


=If(CstFiscalYearQuarterConcat>= Max( TOTAL CstFiscalYearQuarterConcat,5), CstFiscalYearQuarterConcat)


or


=If(CstFiscalYearQuarterConcat<= Max( TOTAL CstFiscalYearQuarterConcat,5), CstFiscalYearQuarterConcat).



View solution in original post

2 Replies
afsarshaikh
Creator
Creator

Hope this works:

Concat(distinct CstFiscalYear ,'-',CstFiscalQuarterNum)

Regards,
Afsar Shaikh
Project Manager- QlikView Dev. & Support
Afsar Shaikh
Email- afsar.shaikh@live.com
Kushal_Chawda

create the numeric quarter value using DUAL function like below in script

=dual(CstFiscalYear & '-' & CstFiscalQuarterNum,CstFiscalYear&CstFiscalQuarterNum) as CstFiscalYearQuarterConcat



Now you can use condition


=If(CstFiscalYearQuarterConcat>= Max( TOTAL CstFiscalYearQuarterConcat,5), CstFiscalYearQuarterConcat)


or


=If(CstFiscalYearQuarterConcat<= Max( TOTAL CstFiscalYearQuarterConcat,5), CstFiscalYearQuarterConcat).