Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to add 'Total' as a bar at the end of the bar chart. If you see my example, I have bar chart for all country with sales and I need to add a bar at the end which shows sales of all countries (which is 100) naming 'Total sales'. IS this possible?. Thanks
Well, I don't think this is a GOOD solution, but it works. Instead of adding the Year dimension, create an expression for each possible Year:
2009: sum({<Year*={2009}>}Sales)
2010: sum({<Year*={2010}>}Sales)
go chart presentation tab enable total
click on total check
Regards
Ashish
Thanks Ashish. This is what I want.
Ashish, what will happen, if I have two dimension. It is not showing the total. See the attachment.
Can someone please help me out....
Well, I don't think this is a GOOD solution, but it works. Instead of adding the Year dimension, create an expression for each possible Year:
2009: sum({<Year*={2009}>}Sales)
2010: sum({<Year*={2010}>}Sales)
Hi Asish Kumar
It is giving the rounded of number. It is not giving the exact number. Please help me out on this!
Thanks
Attitude
I have posted a response to this on this thread: http://community.qlik.com/thread/31295
- Steve
I don't like the solution I posted above, and now favor a different one. The attached example shows that "Show Total" doesn't work for two dimensions, gives the set analysis solution mentioned above, and then gives a data model solution. I suggest the data model solution for two dimensions.
That isn't the problem you're having of course, Attitude. I suggest posting an example with the problem in the other thread. I can do a "Show Total" with all the decimal places just fine.
Here's the script for people using personal edition or if you just want to see how I'm setting up the data model without needing to download the application. Use TypeGroup in the chart instead of Type, and then Year as the second dimension.
Data:
LOAD * INLINE [
Type, Year, Value
Mainframe, 2010, 962.1234
Mainframe, 2009, 632.83
DotNet, 2010, 1572.239847
DotNet, 2009, 1698.23984
Java, 2010, 2829.450987
Java, 2009, 357.9874
];
// This is a little complicated, but should be very efficient on large data sets.
// Smaller data sets could be done more simply, but I figure speed is a good habit to be in.
Types:
LOAD fieldvalue('Type',recno()) as Type
AUTOGENERATE fieldvaluecount('Type')
;
Totals:
LOAD 'Total' as TypeGroup,Type
RESIDENT Types
;
CONCATENATE (Totals)
LOAD Type as TypeGroup,Type
RESIDENT Types
;
DROP TABLE Types
;