Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total of first dimension over second dimension

Hi Friends,

     I Need a pivot Table to show the Sub Total of on dimension as follows

Dimension1 Dimension2Dimension3
Aa2
b2
Total4
Ba3
b3
Total6
Totala5
b5
Total10

How can in acheive this without using set analysis.

11 Replies
martinpedersen
Creator
Creator

I would love to do this kind of "aggregated subtotals" - its a basic function in e.g. Cognos - Does anyone know if there's any plans regarding implementation of this option in QV?

Adam_Smith
Contributor II
Contributor II

I know this is an old thread, but I have found a solution which works well for me so thought I would share it here.

 

In your load script, you can create a separate table with 2 fields... Dimension1 and also Dimension1Total.

Ensure that for every Dimension1, you have both a Dimension1 and a TOTAL listed in the Dimension1Total field.

i.e. below example load script

FactTable:
LOAD * INLINE [
Dimension1, Dimension2, Value
A, a, 2
A, b, 2
B, a, 3
B, b, 3
];

Dimension1Total:
LOAD * INLINE [
Dimension1, Dimension1Total
A, TOTAL
B, TOTAL
A, A
B, B
];

Qlikview's associative engine would then link this table back to your main table on Dimension1.

Adam_Smith_1-1651152422908.png

Now, in your chart you can use the field Dimension1Total as your first Dimension. The chart will now include a row for TOTAL at the top of the table, and each of the Dimension2 fields will be shown in this TOTAL row.

Adam_Smith_0-1651152308009.png