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: 
MikeF
Contributor II
Contributor II

Total column in pivot table does not seem to work with calculation expression

Hello All,

I have a pivot table and it is working properly except for the Total column.  My calculation is resulting in a negative amount, which is not being shown in the dimension column, but it is being included (not shown) in the  Top Total Column

Here is the expression I am using on the measure  

if ((Sum([Estimate$])-Sum([Invoice$])>0), Sum([Estimate$])-Sum([Invoice$]))

Here is the result:

MikeF_1-1663077294696.png

 

Thanks/Mike

 

 

 

Labels (1)
1 Reply
Mario_De_Felipe
Luminary
Luminary

I'm not sure why pivot table has this behaviour (maybe you have hidden nulls values in the dimensions, and you are losing some values from estimate and invoice fileds), but you can try a workaround forcing an expression at the total level:

if(dimensionality()=0, Sum([Estimate$])-Sum([Invoice$]),if ((Sum([Estimate$])-Sum([Invoice$])>0), Sum([Estimate$])-Sum([Invoice$])))