Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm a beginner with Qlikview but I need your help about one thing. I've a dynamic crossed board with an expression which shows products which are not launched in the production. And in this one, I write a function in the category " background's colour", but in this function I need several IF because I want the line becomes red if it's very urgent, orange if we have to do in the next two weeks and white if we are ahead of schedule.
I've the idea to do CTRL+ALT+V and name a variable for every if, for exemple :
- RED_COLOUR = if (sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName( if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) -WeekName(Today(0)) <= 4*7 ,lightred(),white())
- ORANGE_COLOUR = if (sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName( if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) - WeekName(Today(0)) =5*7 ,RGB(255,127,0),white())
But how to combinate them in the definition of the background's colour of my expression ? Or it's possible to put several IF in the same definitiion ?
Thanks for your help !
PS : Sorry for my english's level I'm french ^^
Nest your if statements:
if (sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName(if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) -WeekName(Today(0)) <= 4*7 ,lightred(),
if (sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName(if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) - WeekName(Today(0)) <=5*7 ,RGB(255,127,0),white()))
You could also use a variable to store most of it and make the final expression more readable:
Variable vDeadline: sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName(if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) -WeekName(Today(0))
Color expression: if( $(vDeadline) <= 4*7, lightred(), if($(vDeadline) <= 5*7, rgb(255,127,0), white()))
Nest your if statements:
if (sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName(if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) -WeekName(Today(0)) <= 4*7 ,lightred(),
if (sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName(if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) - WeekName(Today(0)) <=5*7 ,RGB(255,127,0),white()))
You could also use a variable to store most of it and make the final expression more readable:
Variable vDeadline: sum (if(Etat_Atelier='Pas Produit',NB_RP))>=1 and WeekName(if(Date_Liss>4000,Date_Liss+3*7,Semaine_Montage)) -WeekName(Today(0))
Color expression: if( $(vDeadline) <= 4*7, lightred(), if($(vDeadline) <= 5*7, rgb(255,127,0), white()))
Thank you very much ! It works