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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
saumyashah90
Specialist
Specialist

calendar date(Start Date and End date) problem

What to write in expression for date condition if expression has three if conditions

=if(Avg(Metric_value)>=[Threshold-Red],'qmem://<bundled>/Buletin/led_r.png',

if(Avg(Metric_value)>=[Threshold-Amber],'qmem://<bundled>/Buletin/led_y.png',

if(Avg(Metric_value)>=[Threshold-Green],'qmem://<bundled>/Buletin/led_g.png','qmem://<bundled>/Buletin/cross.png')))

i have date condition

=Avg({<Date={'>=$(Start_Date)<=$(End_Date)'}>}Metric_Value)

how can i use it for three if conditions

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Create a variable vAvgMetric and use this as its value:

Avg({<Date={'>=$(Start_Date)<=$(End_Date)'}>}Metric_Value)

Then you can create an expression like:

=if( $(vAvgMetric) >= [Threshold-Red], 'qmem://<bundled>/Buletin/led_r.png',

      if( $(vAvgMetric) >=[Threshold-Amber],'qmem://<bundled>/Buletin/led_y.png',

         if( $(vAvgMetric) >=[Threshold-Green],'qmem://<bundled>/Buletin/led_g.png',

             'qmem://<bundled>/Buletin/cross.png')))



talk is cheap, supply exceeds demand
saumyashah90
Specialist
Specialist
Author

hey Gysbert,

what problem is that...whenever Metric_Value=- or NULL den it should show cross.png...which it is not showing