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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

intersection, set analysis

hi,

Senario:

I have year filter in app. I have a chart in which expressions I have coded as follows:

count({<Year={"$(=GetFieldSelections(Year))"} >}id)

.Problem:

if any selection is made in year filter which is in app(outside the chart), then the expression is fine. else it shows nothing as year will get assigned to null. But it should get assigned to *

is there any way to write using set intersection or any way without using if block in side chart?

12 Replies
swuehl
MVP
MVP

Maybe like

=count({<Year1 = {"$(=If(GetSelectedCount(Year2), Concat(DISTINCT Year2, ','), '*' ))"} >} id)


[

If your Year2 value set is smaller than Year1 set, but you want all Year1 values in case of no Year2 selection.

Otherwise, the p() function as shown by Sunny should do it, too.

]

Not applicable
Author

yes, fields are different say as below:

Yearpole={"$(=GetFieldSelections(Year)

yearpole is field and year is another field.

year is filter outside the chart whose selected value must be assigned to yearpole.

if no selection is made for year it is taking null.  but it should take *  i.e . all values. can u tell me the way without using if block as it  increases load.

Not applicable
Author

fields are different say as below:

Yearpole={"$(=GetFieldSelections(Year)

yearpole is field and year is another field.

year is filter outside the chart whose selected value must be assigned to yearpole.

if no selection is made for year it is taking null.  but it should take *  i.e . all values. can u tell me the way without using if block as it  increases load.