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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart expression - combine 3 ifs

I am new to QlikView, so I may just be missing something obvious here, but I could use some help.

I am trying to create a chart that has a branch number, and then its trend based on whether the current month is greater/less/equal its 6 month average.

I currently have Branch as a Dimension, and then Trend as 3 seperate Expressions:

Trending Up:   if(Persistency>6MoAvg,'Up')

Trending Down:  if(Persisentcy<6MoAvg,'Down')

Trending Same:  if(Persistency=6MoAvg,'Same')

So I get something like:

Branch     Trending Up         Trending Down     Trending Same

1               Up                      -                         -

6               -                         Down                  -

9               -                          -                        Same

But I want to combine these in to one Expression just called Trending and get something like:

Branch    Trending

1             Up

6             Down

9             Same

I'm having trouble figuring out how to do if,if,else instead of just if,else - if that makes sense.    B/c I have three cases, but I want to combine them.

I am sure this is just some simple syntax I'm not thinking of / being able to find.  Any suggestions? 

1 Solution

Accepted Solutions
pat_agen
Specialist
Specialist

hi,

try

if(Persistency>6MoAvg,'Up',

     if(Persisentcy<6MoAvg,'Down','Same') )

should give

if better than 6moAvg then

     up

else

     if worse than 6moAvg then

          down

     else

          same

see if it works

View solution in original post

2 Replies
pat_agen
Specialist
Specialist

hi,

try

if(Persistency>6MoAvg,'Up',

     if(Persisentcy<6MoAvg,'Down','Same') )

should give

if better than 6moAvg then

     up

else

     if worse than 6moAvg then

          down

     else

          same

see if it works

Not applicable
Author

That did it - thanks!  I'd tried some variations of that and just hadn't gotten it quite right.