Report conditional if statement

771
4
05-18-2022 07:04 PM
AnuSawant
Frequent Contributor

Hi there,

I am trying to add a conditional statement in my report so that I can get color coded risk score.

In my survey Risk Score is calculated on a risk probability and impact (various parameters). 

e.g. flood probability - alright

flood impact - severe  

Risk score - Extreme

I am struggling to get the query correct as I am having various parameters for which risk been calculated.

if(${flooding_risk== 'Almost_certain' }and ${flooding_impact== 'Severe'},)Extreme (25)

if(${flooding_risk}== 'Likely' and ${flooding_impact}== 'Severe',)Extreme (20)

result it is showing 

AnuSawant_1-1652925530776.png

I am expecting my result should print only "Extreme (25)" or "Extreme (20)" if its present in the record.

Any help would be appreciated.

 

Thanks,

Anu

0 Kudos
4 Replies
RobertBorchert
Honored Contributor

Where are you generating the report?  i.e. dashboard, etc.

0 Kudos
AnuSawant
Frequent Contributor

Hi Robert,

Using the Survey123 website. Is there any other way to export a report to get this work?

Thanks,

0 Kudos
RobertBorchert
Honored Contributor

setting the color of the font in the code won't change the end result.

You will need to use color coding. But I don't  think it will work in the web site.

You can export the table to excel and manually color code based on the number

AnuSawant
Frequent Contributor

Yes exporting to either word or excel would be the last option. I have been waiting for this colour coding works on the template for long. Hopefully  we will get this thing working sooner or later.

Thanks Robert for your help.

0 Kudos