Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I have a question regarding the use of multiple IF statements.
I am working with 7 product groups, that I am displaying in the same graph. I am using a list box to toogle between each, showing their sales number in the graph.
My question is regarding the feature "Text color" under expression.
I am trying to add different colors depending on which of the 7 products i choose. What I want to do is that sale numbers above xx (depending on the choosen product) are shown in green, and below this number are shown in red. As the sale numbers vary a lot between the 7 product groups the "cut-off" point should be different for each, hence the IF statement.
I tried with the following:
=if( [sales] >='500' and [Product_Group] = '1',rgb(255,110,110),rgb(108,179,63),
if( [sales] >='500' and [Product_Group] = '2',rgb(255,110,110),rgb(108,179,63),
if( [sales] >='500' and [Product_Group] = '3 SW',rgb(255,110,110),rgb(108,179,63),
if( [sales] >='500' and [Product_Group] = '4 5D',rgb(255,110,110),rgb(108,179,63),
if( [sales] >='500' and [Product_Group] = '5',rgb(255,110,110),rgb(108,179,63),
if( [sales] >='500' and [Product_Group] = '6',rgb(255,110,110),rgb(108,179,63),
if( [sales] >='500' and [Product_Group] = '7',rgb(255,110,110),rgb(108,179,63)
)))))))
Again the reason for the IF statements is that the 500 should be different for each product.
I have only been using QlikView for less than a week, so I am sorry if my question and/or programmering is not very clear.
Thank you very much for your help!
Mathias
Hey Ruben,
Alright good. I do understand your way of doing it now, and I will try with this. However, as you also write, overtime Julian's answer is most likely the best, as it is a lot less complicated.
Overall I guess I could work with any of your answers. I will try them all out, and see what works best for me. Thank you all for the very fast and good responses!
Good luck Mathias,
I'm glad than I could help you.
Regards!