Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

'Total' at the end of the bar chart

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

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

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)

View solution in original post

8 Replies
Not applicable
Author

go chart presentation tab enable total

click on total check

Regards

Ashish

Not applicable
Author

Thanks Ashish. This is what I want.

Not applicable
Author

Ashish, what will happen, if I have two dimension. It is not showing the total. See the attachment.

Not applicable
Author

Can someone please help me out....

johnw
Champion III
Champion III

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)

Not applicable
Author

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

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

I have posted a response to this on this thread: http://community.qlik.com/thread/31295

- Steve

johnw
Champion III
Champion III

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
;