Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sofiavaz
Contributor

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
mwoolf
Honored Contributor II

Re: Problem with totals when working with relative values

One thing:

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

sofiavaz
Contributor

Re: Problem with totals when working with relative values

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 "=-".

Community Browser