Getting error for my ifelse

Getting the error: Expression * {severity_score}) / (5 * {severity_score}) for function * has incorrect argument type String * Num. Function syntax expects ‘ * ’
‘<DATETIME_INTERVAL> * ’
‘ * <DATETIME_INTERVAL>’.

Here is my query: ifelse(({ths_score} * {severity_score}) / (5 * {severity_score}) * 100 >= 90, ‘10’, ‘0’

)

Hi @mosunma ,

Welcome to the QuickSight community!

From the error it seems more like a data type issue. Can you confirm that both the fields, severity_score and ths_score, are numeric and not string/date data type definition in the dataset?

Thanks,
Prantika

1 Like

yes they are numeric. i can see the case data

ok, can you share some sample masked data in arena, to check the error ?

Alternately, you can break down the calculated field to debug.
Step 1: try only {ths_score} * {severity_score}
Check if the value is populating
Step 2: add the denom
({ths_score} * {severity_score}) / (5 * {severity_score})

If these 2 works out, then there should be no more error is my understanding. If the error still persists would request you to create a sample in arena for debugging.

Screenshot 2024-06-04 at 10.17.00 AM
the 1st row is the ths_score while the other row is severity

Hi @mosunma,

Thank you for sharing the data. I tried the formula with the same data and it worked without error.
Sorry to check with you again, I see the fields are numeric but can you check what is the data type showing in the QuickSight dataset for these fields?

Also, you can check the sample calculation I did using the data you shared above.

Thanks.

i rerworked it using a parseint and its worked. Thanks

1 Like