Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends
In my QV document I have a straight table where the Expression for Calculated Premium field does not show results as shown below
I have attached my document. Pls advise me to correct my error
Please try like
=if (Aggr(IF(MaxString({<[BCOD]=P([BCOD])>}[BCOD])=[BCOD],[BCOD]),[BCOD])=BCOD,
(num(if (Aggr(IF(MaxString({<[BCOD]=P([BCOD])>}[BCOD])=[BCOD],[BCOD]),[BCOD])=BCOD, sum(PREMIUM)),'##,##0')
-
if (Aggr(sum({$<CC_CODE={'CC*'}>}PREMIUM),BCOD)>0,Aggr(sum({$<CC_CODE={'CC*'}>}PREMIUM),BCOD),0)
),sum(PREMIUM))
Please try like
=if (Aggr(IF(MaxString({<[BCOD]=P([BCOD])>}[BCOD])=[BCOD],[BCOD]),[BCOD])=BCOD,
(num(if (Aggr(IF(MaxString({<[BCOD]=P([BCOD])>}[BCOD])=[BCOD],[BCOD]),[BCOD])=BCOD, sum(PREMIUM)),'##,##0')
-
if (Aggr(sum({$<CC_CODE={'CC*'}>}PREMIUM),BCOD)>0,Aggr(sum({$<CC_CODE={'CC*'}>}PREMIUM),BCOD),0)
),sum(PREMIUM))
Can you tell us what is it that you want to be displayed in the last column?
As always, try to ignore direct field names. And use Simple aggregation Sum() for your data point.
This seems to be the correct answer you are looking for...
if (Aggr(IF(MaxString({<[BCOD]=P([BCOD])>}[BCOD])=[BCOD],[BCOD]),[BCOD])=BCOD,
(num(if (Aggr(IF(MaxString({<[BCOD]=P([BCOD])>}[BCOD])=[BCOD],[BCOD]),[BCOD])=BCOD, sum(PREMIUM)),'##,##0')
-
if (Aggr(sum({$<CC_CODE={'CC*'}>}sum(PREMIUM)),BCOD)>0,Aggr(sum({$<CC_CODE={'CC*'}>}sum(PREMIUM)),BCOD),0)
),sum(PREMIUM))
Please close this thread if your problem is solved
Already Closed ...
already closed