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

Pivottable Totals

Hey Guys!

I've got a Problem with my pivottable.

There is data until YTD (ist) and for the rest a forecast is calculated (prog).
Now I want to combine these columns (kombi).

The problem, as you can see, is that the total is not calculated correctly. Only the ist-valus are considered although the rows are correct.

Does anybody know a solution?

Thanks in advance!!

 
 

image.png

Labels (3)
1 Solution

Accepted Solutions
Kushal_Chawda

@MBV 

sum(aggr(if(Sum({< Jahr={$(YTDYear)} >}[h/VK])= '0' ,
 
(Sum({< Jahr={$(VJ)} >}[h/VK])+ Sum({< Jahr={$(VVJ)} >}[h/VK])+ Sum({< Jahr={$(VVVJ)} >}[h/VK]))/3
 
,Sum({< Jahr={$(YTDYear)} >}[h/VK])),

Monat,Elnkaufe))

Note: If you have other dimensions, add that as well in aggr function

View solution in original post

8 Replies
lironbaram
Partner - Master III
Partner - Master III

hi, 

you need to do something like 

sum(aggr(if(sum(ist)>0,sum(ist),sum(prog)),Monat,Elnkaufe...))

MBV
Contributor II
Contributor II
Author

I'm already using Sum(Aggr()) in my expressions

Kushal_Chawda

What is the expression you are using?

Kushal_Chawda

try to add  field in aggr which is used as column display in pivot

MBV
Contributor II
Contributor II
Author

How would you adjust this Expression using Sum(Aggr())?

 

if(Sum({< Jahr={$(YTDYear)} >}[h/VK])= '0' ,
 
(Sum({< Jahr={$(VJ)} >}[h/VK])+ Sum({< Jahr={$(VVJ)} >}[h/VK])+ Sum({< Jahr={$(VVVJ)} >}[h/VK]))/3
 
,Sum({< Jahr={$(YTDYear)} >}[h/VK]))
Brett_Bleess
Former Employee
Former Employee

The following Design Blog post may be of help on this one:

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

@Kushal_Chawda If you want to have another look, the poster did post the expression...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Kushal_Chawda

@MBV 

sum(aggr(if(Sum({< Jahr={$(YTDYear)} >}[h/VK])= '0' ,
 
(Sum({< Jahr={$(VJ)} >}[h/VK])+ Sum({< Jahr={$(VVJ)} >}[h/VK])+ Sum({< Jahr={$(VVVJ)} >}[h/VK]))/3
 
,Sum({< Jahr={$(YTDYear)} >}[h/VK])),

Monat,Elnkaufe))

Note: If you have other dimensions, add that as well in aggr function

MBV
Contributor II
Contributor II
Author

It's working!! Thank you!