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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help: Maybe something impossible. Cross many values and many variables

Good afternoon. I'm trying to make something and I don't know if it is possible. I have a table, with customers, customer category, Cust. Cat. Discount, item, item category, Item Cat. Discount, sales quantity, real unit price, recommend unit price. Something like this:

CustomerCust. CategoryCust.Cat.DiscItemItem CategoryItem Cat. DiscQuantityReal PriceRecommend Price
Cust1Big15%Item1Food80%1001012
Cust2Middle10%Item1Food80%1025
Cust3Short5%Item2Non Food2%801420
Cust4Short5%Item3Other100%90330

By other side, I have defined variables, one to each Cust. Cat. Discount, and one to each Item Category Discount. (I really have 30 variables of Customer discount and 25 variables of Item Discount. I mean that is too hard try to define all the combinations...

VarDisc_Big = 15%

VarDisc_Middle = 10%

VarDisc_Short  = 5%

VarDisc_Food = 99%

VarDisc_NonFood = 99%

VarDisc_Other     = 99%

Then, My graphics should work like:

I let the user to change the % of each variable and, for each line, I have to test which discount is lower, VarDisc_Of customer or Var_Disc of Item Cat. Then apply this discount to the recommended price.

I have tought to make a very big IF, comparing the value of each line and use the right variable, but is impossible.

I had tought too, if I name of the variable is the same that the possible value, and If I could match each value with the name of the value...... I don't know...I'm lost

IF CustCat is BIG and ItemCategory is FOOD AND VarDisc_Big > VarDiscFood then Apply VarDiscFood ELSE

IF CustCat is BIG and ItemCategory is FOOD AND VarDisc_Big <= VarDiscFood then Apply VarDisc_Big ELSE

IF CustCat is BIG and ItemCategory is NON_FOOD AND VarDisc_Big > VarDisc_NonFood then Apply VarDiscNonFood...

This way is too long

0 Replies