Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ruma_barman
New Contributor II

Showing the number of quarters according to input given by user

Hi All,

I have a chart having fiscal quarter as dimension and sum of sales as measure. The fiscal quarter values are sorted like this

Q1 2016,Q2 2016,Q3 2016,Q4 2016,Q1 2017,....so on till Q1 2018. Now we need to show the number of quarters as given input by user.If he enters 4 ,we need to show the last four quarters Q2 2017,Q3 2017,Q4 2017,Q1 2018 and so on.How to achieve this?

1 Reply
MVP
MVP

Re: Showing the number of quarters according to input given by user

If you create a field in your data model called QuartersAgo you can simply use that field like this:

     Sum( {<QuartersAgo={"<4"}>} Sales )   

You would have to use this set expression in all your measures in a chart. You can still use the dimension that shows QuarterYear for display purposes since it would be associated with the QuartersAgo in the same table.

Community Browser