Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewforum
Creator II
Creator II

How to achieve the given bar chart

How to achieve the below output in barchart? We should always show latest 7 Quarter.(i,e) 2019-Q2 is added it should the bar till 2017-Q4.Also please note that there is no date field provided in the data set.

My idea was to generate the date based in the year start which is 2016 and then achieve the chart using the set analysis.

Please share your thoughts and best approach to achieve this.

Quarter Chart.jpg

 

Labels (1)
1 Solution

Accepted Solutions
vitaliichupryna
Creator III
Creator III

Hi,

You can create index based on Year & Quarter fields, so in your case: Year 2016 and Quarter Q1 will have index 1 and Year 2019 and Q1 will be 13, for this you can use autonumber function AutoNumber([Quarter]&Year, 'Quarter') AS QuarterIndex
After this you can use following set expression:
SUM({<QuarterIndex = {">=$(=Max(QuarterIndex )-6)"} >} Sales)

Thanks,
Vitalii

View solution in original post

2 Replies
vitaliichupryna
Creator III
Creator III

Hi,

You can create index based on Year & Quarter fields, so in your case: Year 2016 and Quarter Q1 will have index 1 and Year 2019 and Q1 will be 13, for this you can use autonumber function AutoNumber([Quarter]&Year, 'Quarter') AS QuarterIndex
After this you can use following set expression:
SUM({<QuarterIndex = {">=$(=Max(QuarterIndex )-6)"} >} Sales)

Thanks,
Vitalii
qlikviewforum
Creator II
Creator II
Author

With the use of =Year&''&Quarter in the dimension with above one as expression it does work.