Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
wallacecruz
New Contributor

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

Tags (2)
1 Solution

Accepted Solutions
lanlizgu
Contributor III

Re: multiple if logic error

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.

3 Replies
lanlizgu
Contributor III

Re: multiple if logic error

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
Valued Contributor II

Re: multiple if logic error

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  
wallacecruz
New Contributor

Re: multiple if logic error

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               

               

            ),

           

        ),

       

)