Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

multiple if logic error

Hello guys and girls,

I have been trying to solved this, but I guess I'm tired, because the logic is escaping my mind.

if

(

    qtde > 15,

    RGB(0,0,128),//NAVY

        if

        (

            qtde <= 15 and qtde >=5,

            RGB(0,0,255),//BLUE

            if

            (

                qtde >=4 AND qtde <=1,

                RGB(30,144,255),//DODGEBLUE

                RGB(173,216,230)//LightBlue               

               

            ),

           

        ),

       

)

I can't make the DodgeBlue work...any ideas? Thanks

1 Solution

Accepted Solutions
lanlizgu
Creator III
Creator III

qtde can't be at the same higher than 4 and less than 1, as there is no any figure with this condition

Could you please share an example of each number?

As far as I understand your development, I understand that you should use an or, not and and for your example.

View solution in original post

3 Replies
lanlizgu
Creator III
Creator III

qtde can't be at the same higher than 4 and less than 1, as there is no any figure with this condition

Could you please share an example of each number?

As far as I understand your development, I understand that you should use an or, not and and for your example.

olivierrobin
Specialist III
Specialist III

try

if(qtcde>15, RGB(0,0,128),//NAVY

     ,if(qtcde>=5,RGB(0,0,255),//BLUE

          ,if(qtcde>=1,RGB(30,144,255),//DODGEBLUE

                    RGB(173,216,230) // lightBlue

          )

     )

)

RGB(173,216,230)//LightBlue  
Anonymous
Not applicable
Author

I made a huge logic mistake...I solved it, but couldn't find my post to delete it.  You are absolutely right Lan Liz. So the correct is:

if

(

    qtde > 15,

    RGB(0,0,128),//NAVY

        if

        (

            qtde <= 15 and qtde >=5,

            RGB(0,0,255),//BLUE

            if

            (

                qtde <=4 AND qtde >=1,

                RGB(30,144,255),//DODGEBLUE

                RGB(173,216,230)//LightBlue               

               

            ),

           

        ),

       

)