Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mattdt1811
Contributor III
Contributor III

Multiple If Statements with Set Analysis

Hi All,

I have drawn up a straight table on Qlikview showing our customer names, and the number of bookings we have insured using the below expression, for years 2015/2016/2017/2018;

EG:

=NUM((TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2018'}>}INSURED)),'###########,###')

Following on this and to show show if booking numbers have increased or decreased compared to 2017, I have used the below expression to highlight the background colour either Green or Red, depending on an increase or decrease;

if(NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2018'}>}INSURED))>(NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2017'}>}INSURED))), rgb(128,255,120), rgb(255,128,128) )

Would someone be able to let me know how I would also include an if statement into this, to highlight yellow RGB(255,255,128) if the number of insured bookings is the same 2017 compared to 2018?


Thanks in advance.

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

May be this?

= if(

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2018'}>}INSURED))>

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2017'}>}INSURED)), rgb(128,255,120),

  if(  

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2018'}>}INSURED))=

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2017'}>}INSURED)), RGB(255,255,128), rgb(255,128,128)))

View solution in original post

2 Replies
vishsaggi
Champion III
Champion III

May be this?

= if(

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2018'}>}INSURED))>

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2017'}>}INSURED)), rgb(128,255,120),

  if(  

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2018'}>}INSURED))=

     NUM(TextCount({$<FreightPaid={'Paid in UK'},INSURED={'INSURED'},Year={'2017'}>}INSURED)), RGB(255,255,128), rgb(255,128,128)))

mattdt1811
Contributor III
Contributor III
Author

Perfect - Many Thanks!