Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

Re: Last 5 rows in Pivot Table

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
Highlighted
Creator
Creator

Re: Last 5 rows in Pivot Table

Hope this works:

Concat(distinct CstFiscalYear ,'-',CstFiscalQuarterNum)

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

Re: Last 5 rows in Pivot Table

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