Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with totals when working with relative values

  Hi all,

I'm using a pivot tible with two calculated dimensions as rows and two fields as columns.

The measure expression is this one:

=if(getfieldselections(AllocTransfInsDate)>0,

count({<AllocTransfTransfStat=-{"CANCEL"}>}AllocTransfAllocTransfId) / sum(DISTINCT aggr(NODISTINCT count({<AllocTransfTransfStat=-{"CANCEL"}>}AllocTransfAllocTransfId),AllocTransfOrigMktDescrip,AllocTransfOrigMillCd)),

count({<AllocTransfTransfStat=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId) / sum(DISTINCT aggr(NODISTINCT count({<AllocTransfTransfStat=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId),AllocTransfOrigMktDescrip,AllocTransfOrigMillCd)))

Does anybody knows why are the totals badly calculated? How can I solve that?

2 Replies
m_woolf
Master II
Master II

One thing:

I believe that "is not equal" should be -=, not =-

Anonymous
Not applicable
Author

Thank you m w. I'm also used to write "-=", I don't know what happened this time. However, when I correct the expression, the output remains the same and it's correct... Maybe now it also works with "=-".