Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparsion of sales in stack bar chart

Hi All,

Is it possible to compare sales of 2016 quarters with 2017 quarters in stack bar chart? But 2017 quarters must be always YTD sales.

Today : 27/07/2017

Ex: Q1 2016 - Jan, Feb, Mar of 2016. But Q12017 should be entire sales of 2017 upto today.

same applies for Q2 2016 - Apr, May, Jun of 2016 but Q2 2017 should be entire sales of 2017 upto today. same applies for Q3 and Q4 as well

Is it possible to achieve this? Thanks to advice

Regards,

Krishna

30 Replies
Anil_Babu_Samineni

I don't have time to work. But, my suggestion is similar this

If(Year = 2016, Sum(Sales), If(Year = 2017, Sum({<DateField = {">= $(=YearStart(Max(DateField))) <=$(=Max(DateField))"}>} Sales)))

And you used Mid() function to achieve this in front end that is the case why can't you achieve in script rather front-end to evaluate.

And if you use Quarter in your statement of expression then this can achieve.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful