Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dzhanito
Contributor II
Contributor II

nested if

This code must not apply to certain items so they can pick them up without *1.2 Sum({< [Item No_] = {"=[Item No_] = [Item No_]"} >} [Unit Price]*1.2)  here are the codes from Item No. which should normally be taken without *1.2

12974,14584,14573,4236,4237,4238,4241,4242,4243,4244,4247,7430,8114,12126,16009,16010,15284,4249,4256,4258,12973,14739,7365,4259,8970,10608,12338,12339,12373,17015,12545,13484,16076,16078,16123,16788

like is script error:=if(Sum({< [Item No_] = {"=12974,14584,14573,4236,4237,4238,4241,4242,4243,4244,4247,7430,8114,12126,16009,16010,15284,4249,4256,4258,12973,14739,7365,4259,8970,10608,12338,12339,12373,17015,12545,13484,16076,16078,16123,16788 =[Item No_]"} >} [Unit Price]),Sum({< [Item No_] = {"=[Item No_] = [Item No_]"} >} [Unit Price]*1.2))

3 Replies
dzhanito
Contributor II
Contributor II
Author

this is how the formula works for me but only for one item and to include more than one how to write the code

=if([Item No_] =4236 , [Unit Price],Sum({< [Item No_] = {"=[Item No_] = [Item No_]"} >} [Unit Price]*1.2)) 

marcus_sommer

I'm not sure if I understand your aim right but I assume you want in the end something like this:

rangesum(sum({< Item = {1, 2, 3}>} Price * 1.2), sum({< Item -= {1, 2, 3}>} Price))

which will sum the price from certain items * factor and all others without the factor and both parts are parameters within a rangesum().

- Marcus 

dzhanito
Contributor II
Contributor II
Author

works thanks a lot 🙂