2 Replies Latest reply: Mar 9, 2018 10:31 AM by Sofia Vaz

# 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?

• ###### Re: Problem with totals when working with relative values

One thing:

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

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