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: 
whitestonek
Contributor II
Contributor II

How to display current Selected values and previous values in Qlik Sense Bar chart

Hi,

I have one Bar chart in QlikSense. Dimension is dates:(01/Mar/2018) format & Measure is Sum(Sales).

as well as i have YTD,QTD & MTD Filters.

-> If i select like 01.apr/2019 now the bar is showing april2019 sales. My requirement is if i select MTD 01/Apr/2019 then the bar should displar apr/2019 sales and mar/2019 sales in single bar.

-> if i select QTD 01/Apr/2019 then the bar should displar apr/2019 sales and apr/2018 sales in single bar.

-> if i select YTD 01/Apr/2019 then the bar should displar From jan/2019 to apr/2019 sales and 2018 sales in single bar.

Do you know how could I obtain this logic?

 

Thanks in advance to all of you!

 

Regards,

kumar

 

1 Reply
miskinmaz
Creator III
Creator III

I am just putting down the algorithm for you:

1. Write first expression with if condition like

if(vButton='MTD', set expression of current MTD,

if(vButton='QTD', set expression of current QTD sales, set expression of current YTD sales)

2. Write expression 2 with if condition like:

if(vButton='MTD', set expression of previous MTD,

if(vButton='QTD', set expression of previous QTD sales, set expression of previous YTD sales)

 

vButton is the variable here and simple set analysis expression for YTD will be like:

sum({<Year={"$(=max(Year))"}>}Sales).