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

Using functions in set modifiers

Hi ,

Am new to Qliksense. Could anyone help me to understand the set analysis syntex better when it comes to using the functions in modifier.

Here are the expression which I used in KPI chart.

sum({<Year = {"$(=max(Year))"}>}yrprice)

sum({<Product = {"=mid(Product,2,1)='i'"}>}Price)

In first Expression why we have used $() and why it is not in second experience. 

If I change the second experience as per first I didn't get the expected results. 

3 Solutions

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

in the first expression, you are using a simple search for a value 
so the dollar causes the qlik engine to calculate the expression once and use the result for the filtering
In the second expression, you are using qlik smart search, this type of search needs to evaluate the expression for each product alone. hence you are not using $ sign 

View solution in original post

anthonyj
Creator III
Creator III

Hi,
I'm interested in other's opinions on this, but from what I see in the documentation is that $( ) expansion is calculated just before the expression is calculated. So it is done once and can therefore only return one value. Eg as of this year currently Max(Year) will return 2021.

"=mid(Product,2,1)='i'" resolves row wise passing the value of Product on that line to the function. For example:

Product    Resolving to                           Result

Pie               "=mid('Pie',2,1)='i'"            True

Cake            "=mid('Cake',2,1)='i'"         False

I hope this makes sense and if someone can provide a correction or confirmation that would be great. 

Thanks

Anthony

View solution in original post

Gang
Contributor II
Contributor II
Author

Thanks both Anthonyj and Lironbaram . Now I understood the difference. It make sense.

View solution in original post

3 Replies
lironbaram
Partner - Master III
Partner - Master III

in the first expression, you are using a simple search for a value 
so the dollar causes the qlik engine to calculate the expression once and use the result for the filtering
In the second expression, you are using qlik smart search, this type of search needs to evaluate the expression for each product alone. hence you are not using $ sign 

anthonyj
Creator III
Creator III

Hi,
I'm interested in other's opinions on this, but from what I see in the documentation is that $( ) expansion is calculated just before the expression is calculated. So it is done once and can therefore only return one value. Eg as of this year currently Max(Year) will return 2021.

"=mid(Product,2,1)='i'" resolves row wise passing the value of Product on that line to the function. For example:

Product    Resolving to                           Result

Pie               "=mid('Pie',2,1)='i'"            True

Cake            "=mid('Cake',2,1)='i'"         False

I hope this makes sense and if someone can provide a correction or confirmation that would be great. 

Thanks

Anthony

Gang
Contributor II
Contributor II
Author

Thanks both Anthonyj and Lironbaram . Now I understood the difference. It make sense.