Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Like Statement for Master Measure

Hi - I am trying to create either a variable or master measure.

Basically I would like to do the following :

- I have a text field in my table named  AdditionalTopics

-  say my table consists of 150+ records

- I would like a sum of all of the records in which the word 'student' is within the text field  AdditionalTopics

- I tried the below as a master measure and created a KPI - no luck

Master measure: Internship

Expression:

If(AdditionalTopics like 'student*',1,0)

 

No luck - any thoughts ? ?

Thanks - jerry

Labels (2)
4 Replies
Anil_Babu_Samineni

May be this?

If(WildMatch(AdditionalTopics, 'student*'),1,0) as Flag

Where as You can call 1 for student and else for 0 like

Sum({<Flag = {1}>} Measure)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jerryr125
Creator III
Creator III
Author

Hi - works !

example :

Added as a master measure

Sum(If(WildMatch(AdditionalTopics, '*student*'),1,0))

Thank you ! Jerry

sunny_talwar

You can use set analysis to do this...

Count({<AddtionalTopics = {"*student*"}>} AdditionalTopics)
OmarBenSalem

Ps: U've created ur question 2 times, here my response on the other topic: please delete the other question

try:

count(distinct {<AdditionalTopics={"*student*"}>} AdditionalTopics)

 

Then, u can create this as a master measure and use it

or create a variable as follow:

vStudent = AdditionalTopics={"*student*"}

 

and use this expression:

count(distinct {<$(vStudent)>} AdditionalTopics)