Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
What if you try
Count({<[Services.Service Name] = {"=left([Services.Service Name] ,1)='*'"}>}[Services.Service Name])
What if you try
Count({<[Services.Service Name] = {"=left([Services.Service Name] ,1)='*'"}>}[Services.Service Name])
@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])
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!
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.