Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
abe786
Contributor III
Contributor III

Possible to limit P() function to dimensional context ?

Is it possible to limit output of p() function to dimension value for which the expression is displayed ?

Please refer to attached code, what I'm trying to do is build a set analysis such that I get possible values using the dimension as a filter for each row of expression. In my case, I get correct output if I select the person value in list box, however when no person is selected the possible function returns all possible values including those for other dimension.

If expression way is not possible to do, please suggest if I can get required output by modifying the data model in some way ?

1 Solution

Accepted Solutions
sunny_talwar

The problem is that the set analysis is evaluated once per chart and when nothing is selected, both products are possible and it displays it for both the Persons. In order to do it on the row level, you can consider using if statement

sum(if(Product = Person_Product, value))

image.png 

View solution in original post

2 Replies
sunny_talwar

The problem is that the set analysis is evaluated once per chart and when nothing is selected, both products are possible and it displays it for both the Persons. In order to do it on the row level, you can consider using if statement

sum(if(Product = Person_Product, value))

image.png 

abe786
Contributor III
Contributor III
Author

Wow, didn't know you could place if clause in aggregation field.

Thanks the solution works perfectly.