Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Subtotals or groups

Hi all.

Slowly getting to grips with Qlikview and it seems that a lot of the 'manipulations' are done within the loading script or expressions.  I wonder if there is another way to go about doing subtotals / groups.

I have a dimension called "Result" and I want to show all the values of "Result" but I also want to show subtotals within the variable.

For example, the results might be..(please excuse the footballing example!)

Result     Count of Result

Goal               4    

Offside           6

Penalty          2

Foul               12

Throw in         9

Corner            7

But in my table (and probably a chart as well) I would like to show "Free Kicks" as the sum of Offside, Penalty and Foul and "Restart" as the sum of Throws and corner, plus a total for all results

Goal               4    

Offside           6

Penalty          2

Foul               12

Free Kick      20

Throw in         9

Corner            7

Restart          16

All results     40

Any advice on this and also any pointers on where to look for very basic guides to expressions, sorting, grouping etc would be very gratefully received

Many thanks

11 Replies
sorrakis01
Specialist
Specialist

Hi,

An easy movement for your example is create a variable or a field in the script with the sum of the 3 fields.

Regards

Anonymous
Not applicable
Author

Thank you for your reply but I am very new to Qlikview so I am not sure what that means!!

Michiel_QV_Fan
Specialist
Specialist

More than 1 solution is possible.

You can add an inline table in your script and add the Result to that table and a main category.

Result field will match in your datamodel based on the name.

Then create a pivot in QlikView and set Partial sum on the new field.

Grouped:

LOAD * INLINE [

    Result, Group

    Goal, Free kick

    Offside, Free kick

    Throw in, Restart

];

etc.

raghavsurya
Partner - Specialist
Partner - Specialist

Hi Paul,

Alternatively you can use Pivot table which enable you to generate partial sums.  You will have to create one mapping column to link

Goal               4   

Offside           6

Penalty          2

Foul               12

with Free Kick and other two with restart.  You can enable show partial sum at the column in Presentation tab to get the desired result.

Anonymous
Not applicable
Author

I am using real and sensitive data so sadly i cant upload

sorrakis01
Specialist
Specialist

Hi,

The solutions of our partners are right. Try this.

Regards,

Anonymous
Not applicable
Author

This seems like what I am looking for!  Although how do I add a mapping column?

On another note, is there anywhere I can find examples of full scripts which include the load and other functions such as Groups, Cross Table (and any other popular tasks I suppose)

sorrakis01
Specialist
Specialist

sorrakis01
Specialist
Specialist

Hi again,

Try this.

Regards.