Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.


Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

2 Replies
Not applicable

Re: Replicate this expression in script?

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
Not applicable

Re: Replicate this expression in script?

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;