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: 
manoj217
Creator III
Creator III

stacked chart

i have a stacked chart with dimension as product and year ,expression as sum(sales)  i have selected two years(2010,2011) and it will shows in stacked chart but i want to show difference in sales (2010,2011) in line graph. that means its a combination of stacked and line chart how to do it

11 Replies
vishsaggi
Champion III
Champion III

Use a combo chart.

Capture.PNG

manoj217
Creator III
Creator III
Author

i need a expression for line chart  i made selections on years it will show in bar chart but in line chart need to show the difference of these two years

vishsaggi
Champion III
Champion III

Can you share a sample to look into and your expected output please?

You can group expressions to show the Years.

manoj217
Creator III
Creator III
Author

load * inline [Sales, Category, Year

100,furniture,2014

220,furniture,2015

330,furniture,2016

33,furniture,2017

100,powder,2014

220,powder,2015

330,powder,2016

33,powder,2017];

example data here, in line graph i have selected 2014 and 2016 manually but if made selections year that will change dynamically and shows difference in line graph

Untitled.png

vishsaggi
Champion III
Champion III

So you mean you want to show that line graph with sales 2016 - 2014 to be static even though you do any selections in Year field?

manoj217
Creator III
Creator III
Author

no if i select 2013 ,2014  line graph need to show difference between those two years ,if i select 2014,2015 it will show for those year what ever i select for those years its need to reflect ,but line graph need to show =lowest year - highest year sales on current selections

vishsaggi
Champion III
Champion III

Create two variables like below in your Variable overview and then use the expression below tin your line graph.

Ctrl+Alt+V variable overview and add two variables vMaxYear and vMinYear. Then use the two expressions

vMaxYear  =Max(Aggr(Concat(DISTINCT Year, ','), Year))

vMinYar     =Min(Aggr(Concat(DISTINCT Year, ','), Year))

Capture.PNG

For your line graph use below expr:

=Sum({< Year = {'$(vMinYear)'} >} Sales) - Sum({< Year = {'$(vMaxYear)'} >} Sales)

vishsaggi
Champion III
Champion III

Did it not resolve what you are looking for?

manoj217
Creator III
Creator III
Author

i want to limit the multiple selections in year list box because i want to show the difference between two years so i want to limit for 2 years ...bar graph shows the sum (sales ) and line graph shows the difference of those two years