Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nevilledhamsiri
Specialist
Specialist

To avoid calculation on repeated reference numbers

I need to calculate penalty of Rs250 for each cancelled policies. I base their reference numbers to do this.But some reference numbers are repeated & I should do the above calculation excluding those repeated numbers.In other words, Rs 250 to be charged only against one reference number. Here the reference numbers are dimension & the related premium value due to these reference numbers too are assigned which is a expression. To make this clear, I may present my case as below:

Ref_Number         Class           Policy_Number          Premium(Rs)

RA000C125           MC                     RA1C                         500

RA000C125           MC                      RA1C                         250

RA000C128           FR                       RA1D                         320

RA000C150            FR                       RA1K                         250                   

EM000C200            MC                     EM1A                        100

EM000C300            FR                      EM1B                         200

EM000C200           MC                        EM1A                         50

I have written expression as follows!

sum({<Ref_Number={'MC'}>}250)

As per above, Rs 250 is calculated twice on RA000125, EM000C200 Ref numbers. Help me to avoid this by having included some logic in to my above set analysis.

Thanks.

Neville

1 Solution

Accepted Solutions
sunny_talwar

250 is calculated twice? I am not sure I understand?

View solution in original post

3 Replies
nevilledhamsiri
Specialist
Specialist
Author

NOT YET REPLIED. PLEASE RESPONSE

sunny_talwar

250 is calculated twice? I am not sure I understand?

Anil_Babu_Samineni

I think, you need something like below

FirstSortedValue(DISTINCT [Premium(Rs)], -Aggr(Sum([Premium(Rs)], Ref_Number)


OR


Aggr(FirstSortedValue(DISTINCT [Premium(Rs)], -Aggr(Sum([Premium(Rs)], Ref_Number), NonAggrDim, ...)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful