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

Set Analysis Excluding All Selections

Hi All,

Using Set Analysis can we Exclude all the selections Except one field.

sum({1<FIELD1=FIELD1>} Sales) : This does not work.

Does any one have other alternatives.

Regards,

MAK

17 Replies
Not applicable
Author

Thank You Very Much.

I had "-" in my value, that is why it was giving problem. Now solved.

Not applicable
Author

=sum( {1 <Field3= {$(= '"'& concat( Field3,'", "' )& '"')}>} Sales)

Some improvement to your code. This works even for bad data.

rbecher
MVP
MVP

This will return a quoted value list which is much better. But I wonder why you're using concat instead of getfieldselection?

Astrato.io Head of R&D
Not applicable
Author

The above solution is good for QV 8.5 and it makes the chart little slow.

Is there any other faster solution in V 9.0 or V 10

johnw
Champion III
Champion III


Ralf Becher wrote:I wonder why you're using concat instead of getfieldselection?


Well, the difference would be if nothing is selected, everything ends up on the concat() list, and nothing ends up on the getfieldselections() list. So it depends on if you want nothing or everything, I guess.

I'm not on 9.0 yet, but doesn't it let you specify the set of all possible values for a field? So you can very directly just say "ignore all selections, except for this field, where you should use all possible values". Someone else will have to supply the syntax. I suppose I could look it up if I weren't lazy, but I'm lazy.

tanelry
Partner - Creator II
Partner - Creator II

> =sum( {1 <Field3= {$(= '"'& concat( Field3,'", "' )& '"')}>} Sales)
> Some improvement to your code. This works even for bad data.

Just for refinement, try if this improves the performance: ... concat( distinct Field3, ...

By ignoring any duplicate values, it should work better in case your Field3 is heavily populated.

johnw
Champion III
Champion III

[quote user="Tanel Rüütli"]

> =sum( {1 <Field3= {$(= '"'& concat( Field3,'", "' )& '"')}>} Sales)
> Some improvement to your code. This works even for bad data.

Just for refinement, try if this improves the performance: ... concat( distinct Field3, ...

By ignoring any duplicate values, it should work better in case your Field3 is heavily populated.



Ah, yes. I've made THAT mistake before. Definitely use distinct if your field values are not already distinct. It can make a huge difference in performance.

Not applicable
Author

This Works for V9.0

sum( {1 <Field3= P(Field3)>} Sales)