Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Chrisc0276
Contributor II
Contributor II

How do I Filter a Dimension by if it contains certain text?

Hello all,

I have a Chart that contains several Dimensions and one Measure.  I want to filter one of the dimensions by if it contains the letter X.

I only want to see lines that have the letter X in them.

Event Title         Date              Amount

Cloth Shopping     1/1/2023    100.00

Food Shopping    2/1/2023      125.000

X - Car Shopping   3/1/2023  55,000.000

 

I want to filter this chart to only show the Event Title that has an X in it.  Is this possible?

Labels (4)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

It's the same as SUMIF of excel in Qlik or an IF() function embedded in a sum, something like

Sum(If(Condition), Value)

Which is used as a chart expression.

Alternatively, you achieve the same thing using a calculated dimension as below and suppress when the value is null.

If(WildMatch([Event Title],'*X*',[Event Title])

View solution in original post

4 Replies
BrunPierre
Partner - Master II
Partner - Master II

Sum(If(WildMatch(Event Title],'*X*'),Amount))

or

Sum({$<Event Title]={'*X*'}>}Amount)

Chrisc0276
Contributor II
Contributor II
Author

I tried this

Sum(if(WildMatch([Event Title],'*X*'),  Amount))

Why is the else_expr Expression using the Amount?

when i use this, i get an error. Invalid Dimension

I have several lines in my chart with "X", and I want to see all the data on those lines, not just the Amount.  

Do i enter this formula in the Show Column IF area?

BrunPierre
Partner - Master II
Partner - Master II

It's the same as SUMIF of excel in Qlik or an IF() function embedded in a sum, something like

Sum(If(Condition), Value)

Which is used as a chart expression.

Alternatively, you achieve the same thing using a calculated dimension as below and suppress when the value is null.

If(WildMatch([Event Title],'*X*',[Event Title])

Chrisc0276
Contributor II
Contributor II
Author

thank you so much, that worked!!!