Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I am working on QlikSense. I know that we cannot use more than 2 dimensions in a Stacked Bar chart. So I have decided to create a multiple Barcharts with the 3rd dimension. Can someone please help with the logic. Please find the information below.
Dimension 1: YEAR (This goes on x-axis)
Dimension2: Fruits exp: Apple, Banana, Grapes (This goes to the colors)
Dimension3: if(aggr(sum(sales),company,year)>50,greater than 50',if(aggr(sum(sales),company,year)<50,'Less than 50',if(aggr(sum(sales),company,year)>50 and aggr(sum(sales),company,year)<100,'50 to 100',if(aggr(sum(sales),company,year)>100 and aggr(sum(sales),company,year)<200,'100 to 200')))). So i have 4 dimensions or Categories from this expression.
Measure: Sum(Sales)
Since I do not have an option to show 3 dimensions in one single bar chart. I want to split the bar chart into 4 based on my 3rd dimension expression.
Thanks in Advance,
-Vidya
That would be a good idea
So this is how I fixed the issue. Thanks to the community and collaboration.
[Size Table]:
load
year,
company,
if(aggr(sum(sales),company,year)>50,greater than 50',if(aggr(sum(sales),company,year)<50,'Less than 50',if(aggr(sum(sales),company,year)>50 and aggr(sum(sales),company,year)<100,'50 to 100',if(aggr(sum(sales),company,year)>100 and aggr(sum(sales),company,year)<200,'100 to 200')))) as Size
resdient [Main Table]
group by year, Company;
if(wildmatch(Category1,'*Apple*') and Flag=0 then 'Green Apple',
if(Category2 = 'Grapes' and Flag =1 then 'Red Grapes',
'All other fruits'
)) as Fruits
Chart1: Sum({<SIZE={"greater than 50"}>}sales)
Chart2: Sum({<SIZE={"less than 50"}>}sales)
Chart3: Sum({<SIZE={"50 to 100"}>}sales)
Chart4: Sum({<SIZE={"100 to 200"}>}sales)
Sum({<SIZE={"greater than 50"}>}sales)/ AGGR(sum({<SIZE={"greater than 50"}>} total <year> sales)
,YEAR,category1,category2,Flag)
Final Result:
Thanks,
-Vidya