My IfElse Calculated field isn't working as intended

Hello! I created a calculated field to count the number of times a specific type of ailment is occurring within a data set. The calculation I am using is - ifelse(site = ‘KIDNEY & RENAL PELVIS’,1,0)

This isn’t working even when the field is KIDNEY & RENAL PELVIS

Just showing all 0’s down the column…any help would be awesome

Hello,
Try:

countIf (
    <select a measure or dimension here>,
    # Conditions
        site= 'KIDNEY & RENAL PELVIS'
)
2 Likes

Hi,

could you test it with trim(toUpper(site))?

Your calculation should work, so maybe the data is not completely clean

1 Like

I like both of the previous replies. Another approach would be to embed that calculation in you custom SQL, if you are using custom SQL.

2 Likes