Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Use a combo chart.
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
Can you share a sample to look into and your expected output please?
You can group expressions to show the Years.
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
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?
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
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))
For your line graph use below expr:
=Sum({< Year = {'$(vMinYear)'} >} Sales) - Sum({< Year = {'$(vMaxYear)'} >} Sales)
Did it not resolve what you are looking for?
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