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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mbeccaria
Contributor II
Contributor II

Using Asterisk literal in set analysis count function?

I'm trying to get a COUNT of [Services.Service Name] where the [Service Name] starts with an asterisk.

This works for the letter "A":

Count({<[Services.Service Name] = {"A*"}>}[Services.Service Name])

But I can't figure out how to use an asterisk as a string literal in a set aggregate function. I tried multiple things. Any ideas?

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

What if you try

Count({<[Services.Service Name] = {"=left([Services.Service Name] ,1)='*'"}>}[Services.Service Name])

View solution in original post

4 Replies
stevejoyce
Specialist II
Specialist II

What if you try

Count({<[Services.Service Name] = {"=left([Services.Service Name] ,1)='*'"}>}[Services.Service Name])

Kushal_Chawda

@mbeccaria  not sure how exactly do you want to search asterisk but you could try below if you just want to search asterisk

Count({<[Services.Service Name] = {"?*?"}>}[Services.Service Name])

 

mbeccaria
Contributor II
Contributor II
Author

That did it! I didn't think to use the left operator. I was working on using replace to replace the * with an alternate character that would work in a query. This is much more elegant. Thanks!

stevejoyce
Specialist II
Specialist II

Yea i think that's the other option.  But i agree, if you know it's your first character, this is much easier to read.  i would do replace if it could be anywhere in your string.