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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
greend21
Creator III
Creator III

Don't Include Data unless selected

Hi,

I want my data to exclude a certain field unless the selection for it on the list box is selected. Is this possible? I was trying set analysis but cannot get it.

According to this page, the below set analysis excludes the year 2000 unless it is selected.

Set modifiers with set operators ‒ Qlik Sense

sum( {$<Year = Year + ({“20*”,1997} – {2000}) >} Sales )

My set analysis is as follows. FieldB has two options, Y and N. I want the data to exclude FieldB Y values unless I select it from a listbox.

Sum({$<FieldB = FeldB -({Y}) >}FieldA)

Labels (1)
5 Replies
vishsaggi
Champion III
Champion III

May be try this?

= Sum({$< FieldB = {"*"} - {'Y'} >} FieldA)

sunny_talwar
MVP
MVP

May be this

=Sum({<FieldB -= {'Y'}>+<FieldB = {"$(=GetFieldSelections(FieldB))"}>}FieldA)

greend21
Creator III
Creator III
Author

Closer, but this then ONLY shows field B when selected

sunny_talwar
MVP
MVP

It is showing me N without selection, what is the problem?

Capture.PNG

trdandamudi
Master II
Master II

I modified Sunny expression, Is this what you are looking for?

If(GetFieldSelections(FieldB)>1,
Sum(FieldA),
Sum({<FieldB -= {'Y'}>+<FieldB = {"$(=GetFieldSelections(FieldB))"}>}FieldA))