Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
brigadier
Contributor II
Contributor II

Create a chart that sums a value grouped by selected criteria

I am very new to Qlikview so first off apologies for asking what is most likely a really straightforward question. But not only that, asking it rather badly.

I am currently using a sandpit of a couple of SQL tables while we start to get an idea of what we want to achieve. I know how to do it in SQL, namely this query:

  select sum(value), res

  from QLIKVIEW_99_GLMONEY MONEY

  inner join QLIKVIEW_99_GLMAPPER mapper

  ON money.CCCode = mapper.cccode

  group by res;

that returns these results:

value res

50000.00 RES02

100000.00 RES01

200000.00 RES02

75000.00 RES01

I want to be able to produce that in a simple chart. But am unable to figure out how. Having done that I would also like to be able to select the other criteria to group by - Act and Col - so that it calculates the sum of the value according to that criteria.

1 Solution

Accepted Solutions
brigadier
Contributor II
Contributor II
Author

I had a colleague look into this. He has pointed out that it was because I had the field that I was trying to aggregate by included as a dimension. So once I removed Value and WTEact from the dimensions, the chart worked the way I wanted it to.

View solution in original post

5 Replies
sunny_talwar

The attached qvw has section access... would you be able to remove it and repost the document?

Anonymous
Not applicable

You also use a Group By statement in the LOAD script. Something like this:

LEFT JOIN(SourceTable)

LOAD res,

     Sum(Value) AS TotalValue

Resident SourceTable Group By res;


https://help.qlik.com/en-US/sense/February2018/Subsystems/Hub/Content/Scripting/ScriptRegularStateme...

shiveshsingh
Master
Master

can you paste data or script here? or remove section access from your shared qvw

brigadier
Contributor II
Contributor II
Author

Sorry, oversight on my part. I have removed the section access and also copied the data from the SQL connection into an inline table so it is present in the model for you to see. What I want to do is in the third table:

1) Sum the value grouped by Res.

2) Be able to change the grouping from Res to Col or Act. !

brigadier
Contributor II
Contributor II
Author

I had a colleague look into this. He has pointed out that it was because I had the field that I was trying to aggregate by included as a dimension. So once I removed Value and WTEact from the dimensions, the chart worked the way I wanted it to.