Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Columns in Pivot table

Hi all, I'm not sure if I'm missing a trick but I have a requirement where I have to show the Sum of measures of a row in a Pivot table but with dimensions going across and the measures going down, e.g.

Pivot_Structure.PNG

Any help appreciated!

Many thanks

12 Replies
Digvijay_Singh

Check this, I created variable in script and later used in expression -

Digvijay_Singh

Let vNoOfFields = NoOfFields('T1');

Let vConcat='';

For i = 1 to vNoOfFields-1

  Let vConcat = vConcat & 'Sum(['&FieldName(i+1,T1)&'])+';

Next

vConcat = Left(vConcat,Len(vConcat)-1);

Not applicable
Author

Yes I think building the string in the load script looks like the best approach, thanks for the tip!!!