Discussion Board for collaboration on QlikView Scripting.
Hi All ,
I am just not sure about the exact script which would dynamically calculate the price for number of item purchased .
Manual steps of Pricing calculation
Using above , i need to calculate the price for list of nbr of items below
Yes, there is a small bug with the previous() which needs to be replaced with peek() and also iterno() needs to be reduced to one - therefore try it with:
View solution in original post
Adding all big shots
@sunny_talwar @tresesco @marcus_sommer
I think it looked more complicated as it is - just try the following:
map:mapping load Item, rangesum([Price Per Item], previous([Price Per Item])) as Price;load [Nbr of Item lower limit] + iterno() as Item, [Price Per Item] while [Nbr of Item lower limit] + iterno() <= [Nbr of Item Upper limit];load * inline [Nbr of Item lower limit Nbr of Item Upper limit Price Per Item0 5 1006 10 5011 18 2019 24 525 100 1] (txt, delimiter is \t);
final: load *, applymap('map', [Count of Item Purchased], 0) as Price from Source;
Thank You Marcus . But with my lil modification it didnt work . Request you to attach a sample qvw .
Thank You Marcus ... Wow this worked exactly i needed