Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
Saryk
Partner - Creator II
Partner - Creator II

If() text condition help

Hello,

I want to sum([Alerts]) if (impact='1*'), or if (impact='2*'), up until impact='4*' as a measure in a bar graph.

If I write

=Sum({<Impact={"1*"}>}[Alerts])

it works fine, but I can no longer filter on impact types.

I'd like to have something like 

=if(impact='1*', Sum(Alert))

or 

=if(WildMatch(Impact, '1*'),Sum([Alert]))

but neither of those works.

Any idea of what I'm doing wrong ?

Labels (2)
1 Solution

Accepted Solutions
Sergio3
Partner - Contributor III
Partner - Contributor III

Hi,

If u want filter on impact types,

U need "*":

=Sum({<Impact*={"1*"}>}[Alerts])

View solution in original post

3 Replies
Sergio3
Partner - Contributor III
Partner - Contributor III

Hi,

If u want filter on impact types,

U need "*":

=Sum({<Impact*={"1*"}>}[Alerts])

Saryk
Partner - Creator II
Partner - Creator II
Author

Well, it seems to work fine if I flip it around : 

=Sum(if(Left(Impact, 1)='1',Alerts,0))

Thanks anyway, hope this helps someone in the future ! 

Saryk
Partner - Creator II
Partner - Creator II
Author

Or that, I just checked and it works.

Thank you, it looks cleaner than my solution !