Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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).