Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replicate this expression in script?

Hi everyone,

Listed below is an expression that I am using in one of my pivot tables. I am wondering if it is possible to replicate this in the script and create a column that does the same thing.

if(sum(TOTAL <Person> amount) <= 700000, sum(amount*.0000),

if(sum(TOTAL <Person> amount) > 700000 and sum(TOTAL <Person> amount) <= 1100000, sum(amount*.0005),

if(sum(TOTAL <Person> amount) > 1100000 and sum(TOTAL <Person> amount) <= 1500000, sum(amount*.0010),

if(sum(TOTAL <Person> amount) > 1500000 and sum(TOTAL <Person> amount) <= 2000000, sum(amount*.0020),

if(sum(TOTAL <Person> amount) > 2000000, sum(amount*.0030))))))

Basically what I am trying to do is sum all of the loan values that apply to a specific person on a specific close date and then assign a corresponding field value for each row.

So for example, if Person A has 7 loans that closed on March 31st, 2015 and the total of those 7 loans is 1000000 the new field will display whatever the loan amount is for each given loan * .0005.

Is this possible to do in the script?

Thank you

Labels (1)
2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Is this possible to do in the script?

Probably. Can you post a Qlikview document with the script and the pivot table?


talk is cheap, supply exceeds demand
anbu1984
Master III
Master III

Load *,

if(SumAmt <= 700000, SumAmt*.0000,

if(SumAmt > 700000 and SumAmt <= 1100000, SumAmt*.0005,

if(SumAmt > 1100000 and SumAmt <= 1500000, SumAmt*.0010,

if(SumAmt > 1500000 and SumAmt <= 2000000, SumAmt*.0020,

if(SumAmt > 2000000, SumAmt*.0030)))));

Load Person, Sum(amount) As SumAmt Resident Source;