Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anyone help me how to show total bar(Sum of all other bars) at the end in bar chart.
Concatenate a hardcoded flag 'Total' to your fact table dimension which you are using in your bar chart.
In frontend expression use if() condition : if(Dimension='Total' , sum(total measure) , sum(measure))
Eg:
test:
load * inline
[
month,sales
Jan,10
Feb,20
Mar,30
];
concatenate (test)
TotalTable:
load * inline
[
month
Total
];
Frontend expression:
if(month='Total' , sum(total sales) , sum(sales))
Regards,
Aditya
Thanks Aditya,
But my requirement is like this
I want to show the right chart data in first chart and in filter I have to select months.
@V_Gautam_Raju I can't clearly understand your requirement just by looking at the screenshot. As mentioned by you earlier, you wanted total bar which sums up all other bars.
Do you want monthwise bar chart or Category wise bar with sum total shown as month ?
Regards,
Aditya
That looks like an entirely different chart, with a different Y axis scale. If that's what you're after, just create two separate charts. If you were to add a total to the existing chart, typically this makes the component bars too small to be useful, so I'd recommend against that approach in most cases.
Note that you can also add a total to a chart using chart level scripting - https://community.qlik.com/t5/New-to-Qlik-Sense/Chart-Level-Scripting-Use-Case/td-p/1973024
Hi Aditya,
I want category wise total
Sorry for the late reply. If you want category wise total, you can use the same method mentioned my me earlier. Just concatenate a total flag in the script to your fact table containing Category field and use provided measure expression in your bar chart measure.
Regards,
Aditya
Hi Aditya,
I want category wise bar with sum total shown as month.