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
sunny_talwar

Try this:

Count({<Year=p(Year)>}id)

UPDATE: I don't understand why do you even need it? Is Count(id) not working the same way?

swuehl
MVP
MVP

If you want Year just to follow the possible values of the Year list box, just remove the Set Expression:

=Count( id)

Mark_Little
Luminary
Luminary

Hi,

what is it your trying to do with the set analysis?

As the above statements say, Count(id) would be what you want, as it will count everything until selections are made

Your set analysis is saying show me the count of id, where the they match the selections of year list. Thus why null when nothing is selected.

Mark

Not applicable
Author

The problem is year field in left side of '=' is different from that of in right side.

both belongs to different tables and I have to fetch year selected from outside chart and assign to another year field in side the chart(both year fields have different data)

Year={"$(=GetFieldSelections(Year)

Not applicable
Author

The problem is year field in left side of '=' is different from that of in right side.

both belongs to different tables and I have to fetch year selected from outside chart and assign to another year field in side the chart(both year fields have different data)

Year={"$(=GetFieldSelections(Year)

Not applicable
Author

The problem is year field in left side of '=' is different from that of in right side.

both belongs to different tables and I have to fetch year selected from outside chart and assign to another year field in side the chart(both year fields have different data)

Year={"$(=GetFieldSelections(Year)

sunny_talwar

Then may be this:

Count({<YearField1=p(YearField2)>}id)

Mark_Little
Luminary
Luminary

Hi,

So i think you have an issue more with the data model, I would be looking to associate the two date fields in a link table or conical calendar.

Canonical Date

Mark

Colin-Albert
Partner - Champion
Partner - Champion

If both fields have the same name (Year) they are the same data.

For them to be different they must have different names.

Have a look at your data model.