Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
nevilledhamsiri
Specialist
Specialist

Error in Set expression

Dear Experts!

My issue is this.

I have linked refunded policies with refunded GL transfer balances. The link was basically with Credit note no. I need following conditions to be met & once it is met to compute Rs 250/= for all such cases.Followings are my conditions,

Class code= MC, M4

Reasons=Customer request

Premium< CR_PREMIUM

then to calculate Rs 250/=

To incorporate above,  I have applied following set expression but it doesn't produce expected results. Can my dear friends to look in to this & see where I have gone wrong!

SUM({<REASON={'CUSTOMER REQUEST'},CLASS_CODE={'MC','M4'},PREMIUM ={"=PREMIUM>CR_PREMIUM" }>}250)

Regds

Neville

1 Solution

Accepted Solutions
tomhoch1
Partner - Contributor II
Partner - Contributor II

Not sure if you are trying to obtain a distinct value of 250 for each row in the table or trying get to a value of 250 for each instance.  But here are 2 formulas, one for each. I added aggregation functions to the premium comparison.


count(distinct {<REASON={'CUSTOMER REQUEST'},CLASS_CODE={'MC','M4'},PREMIUM ={"=sum(PREMIUM)>sum(CR_PREMIUM)" }>} 1) * 250

sum({<REASON={'CUSTOMER REQUEST'},CLASS_CODE={'MC','M4'},PREMIUM ={"=sum(PREMIUM)>sum(CR_PREMIUM)" }>} 250)

View solution in original post

20 Replies
nevilledhamsiri
Specialist
Specialist
Author

Here, Premium should be > CR_Premium

nevilledhamsiri
Specialist
Specialist
Author

Hi Dear please help me on this!

Neville

pradosh_thakur
Master II
Master II

try this may be

Make sure your Fields are spelled correctly

SUM({<REASON={"CUSTOMER REQUEST"},CLASS_CODE={'MC','M4'},PREMIUM ={"=(PREMIUM>CR_PREMIUM)" }>}250)

Learning never stops.
nevilledhamsiri
Specialist
Specialist
Author

Hi Pradosh

That too doesn't help me to get the results. Could you please look in to this again

Regards

Neville

vishsaggi
Champion III
Champion III

What is 250 in your sum() is that Field name?

May be Try below:

= SUM({< REASON={'CUSTOMER REQUEST'},

                 CLASS_CODE={'MC','M4'},

                 PREMIUM = {'>CR_PREMIUM'} >} 250)

pradosh_thakur
Master II
Master II

Hi Neville

as Viswarath rightly asked what is 250 ? are you sure your field value are in upper case? I mean case sensitivity might be giving you wrong results.

regards

Pradosh

Learning never stops.
nevilledhamsiri
Specialist
Specialist
Author

Hi Vishwarath, Pradosh,

Even the expression proposed by Vishwarath doesn't work. Rs 250 is not a field, If the said conditions are met Rs 250 for such policies to be charged with. That is my requirement. If you propose some other expression or something to be done in the script to get the out put that will be alright.

Please see to this & help me

Regds

Neville

vishsaggi
Champion III
Champion III

I am unable to open your qvw file. Can you post your script here so that i can just load the files. Please post the actual expression too rather than 250 in your sum expression.

nevilledhamsiri
Specialist
Specialist
Author

Hi Vishwarath,

Please refer below

REFUNDS:

LOAD BRANCH, CLASS_CODE, PRODUCT_CODE, POLICY_NO, NAME_OF_INSURED, CREDIT_NOTE_NO,

     CREDIT_NOTE_DATE, PERIOD_FROM, PERIOD_TO, PREMIUM, ADDRES, REASON, FINANCIAL_INTEREST,

     ME_CODE, ME_NAME

FROM (ooxml, embedded labels, table is Sheet1);

REFUNDS_GL:

LOAD REASON, CREDIT_NOTE_NO, DATE, CR_PREMIUM

FROM (ooxml, embedded labels, table is [RF(RA)]);

"expressions"

SUM(PREMIUM)

SUM(CR_PREMIUM)

SUM({<REASON={'CUSTOMER REQUEST'},CLASS_CODE={'MC','M4'},PREMIUM ={"=PREMIUM>CR_PREMIUM" }>}250)