Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am having a stacked bar chart in which I display entities based on sales of current year(Sorted in descending order based on sales value).
Now for those entities the stacked bars consists of percentage change in sales of products in this year compared to that of last year
I will explain above statment with an example
Entity | Product | 2018 Sales | 2017 Sales |
---|---|---|---|
A | 1 | 80 | 50 |
A | 2 | 60 | 50 |
B | 1 | 90 | 40 |
B | 2 | 70 | 40 |
C | 1 | 30 | 80 |
C | 2 | 40 | 80 |
Now my Graph will be having entities sorted on the sum of sales of product 1 and 2 for 2018
B
A
C
But the stacked bar in front of these entities will be having % change in sales of product 1 and 2 for each entity for the year 2018 and 2017.
Now what I am trying to do is get the sales of 2018 next to the entity names in bar chart.
For that I wrote an expression
sum(Sales)
With this I am able to get sales for B,A,C next to them but they are overlapping.Since sales for product 1 and 2 is shown seperately.
What I get
B 90,70 overlapped
A 80,60 overlapped
C 30,40 overlapped
What I want
B 160
A 140
C 70
I want the sum of sales for product 1 and 2 next to entity.Not the individual sales
I want the total sales and not at dimension level(My chart has dimension as Entity and Product for stacked bar)
I even tried using sum(Total Sales) but that is giving very weird results
Note:2018 is the year selected by user and not a hard-coded year.
Thanks in Advanced for any help
Hi,
refer the attached qvw file.
Hope this helps
Thanks,
Pooja
Hi,
Thank you for your answer but I am using a personal edition so cant open that file.Can you please post the formula and the settings you have made to graph.
Also I want sum() to be as text on axis.
In your graph it seems to be sum() of the values represented by bars.
My use case is bit different.My stacked bars represent something different ( they represent change as compared to that of last year) and I want some of the entity as text on axis.
May be like this:
Dim: Entity, Product
Style - Stacked.
Sum({<Year = {'2018'}>}sales)
OR
Sum({<Year = {'$(=max(Year))'}>}sales)