Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis GetFieldSelections

Hi,

I have attached sample App. I have chart where I need to show always Location NA data and Selected Dept. Other list box selections should not change the data set. This is the code i have.

Sum

( {1<Loc ={NA} ,Dept =$(=GetFieldSelections(Dept)) >} Sal )





Please let me know what i am doing wrong here ?

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

This is exactly what i was looking for...Thanks a bunch Anthony 🙂

View solution in original post

5 Replies
Not applicable
Author

Hi Boopathi,

Use this in your expression. The "=" for HireDt and Emp disregards any selection made for these listboxes.

Sum



({$<Loc={'NA'} ,HireDt= , Emp= >} Sal)

Miguel_Angel_Baeyens

Hello

There are several things here about syntax. First, if values are strings (or some of them are) they must be quoted. GetFieldSelections doesn't do that. Apart from that, always the left side is a field and the right side is between curly brackets. But most important, modifiers in set analysis are affected by selections, so you don't need to say Dept = Dept. It's implicit. So your expressions will look like

Sum({1< Loc = {'NA'} >} Sal)


If there is no values selected in Dept, then all of them are possible, so that will return the sum of Sal for Loc = 'NA' accordingly. If there are some of them, you chart will reflect it.

Hope that helps.

Not applicable
Author

Thanks Anthony. This may work but when we add new list boxes i may need to modify this everytime. I'll bug you tomorrow in office 🙂

Thanks Miguel. If i keep only Loc={'NA'}, Selections in HireDt or Emp may reduce the data. I dont want that. I need to consider only Dept selction. Can I have single quote with GetFieldSelections?

Not applicable
Author

I have modified the expression so that it will effectively disregard all other selections besides Dept and you don't have to modify the expression each time new listboxes are added

Enjoy !

Sum( {1<Loc={'NA'}, Dept= {$(vDept)}>} Sal)

where

vDept =If(IsNull(GetFieldSelections(Dept)), '*', GetFieldSelections(Dept))

Not applicable
Author

This is exactly what i was looking for...Thanks a bunch Anthony 🙂