Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Highlighted
Partner
Partner

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
Highlighted
Partner
Partner

Re: If() text condition help

Hi,

If u want filter on impact types,

U need "*":

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

View solution in original post

3 Replies
Highlighted
Partner
Partner

Re: If() text condition help

Hi,

If u want filter on impact types,

U need "*":

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

View solution in original post

Partner
Partner

Re: If() text condition help

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 ! 

Highlighted
Partner
Partner

Re: If() text condition help

Or that, I just checked and it works.

Thank you, it looks cleaner than my solution !