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: 
simonb2013
Creator
Creator

Synchronizing 2 field filters

In simple terms, on my 'home' tab,  I want users to select from one of two list boxes :

  • [Data Number] or
  • [Date Value]

For subsequent sheets, I am utilizing function : GetFieldSelections(<field>)

As I am offering the user 2 fields to select from, I am having to constantly reference both fields, which leads to lots of if/and/or/but scenarios - complicating set analysis much more than it needs to be.

So, I am looking for a way to consolidate the users selections back into 1 field.

Example (using table below) :

If a user selects [Date number] 2, then both [Date Value] '02/01/2017'  AND '13/02/2017'  need to become 'Selected'

I am thinking that this can be done via triggers, but not quite worked out the method as of yet !

Any tips welcome

   

CategoryDate ValueDate Number
A01/01/20171
A02/01/20172
A03/01/20173
B01/01/20171
B13/02/20172
B13/03/2017

3

4 Replies
Anonymous
Not applicable

If you load your table as a logical table in Qlik rather than a se of disconnected fields, there is nothing special needed.  When you select Date Number = 2, the corresponding values of the Date Value become "possible"  (indirectly selected,if you wish).
(Not clear from your description why you need GetFieldSelections(), if you have a reasonable data model.)

simonb2013
Creator
Creator
Author

.. because I want to isolate values from those selected  :

v1 = SubField(GetFieldSelections([Data Value], ';', 12 ),';',1)

v2 = SubField(GetFieldSelections([Data Value], ';', 12 ),';',2)

If there is a way to do this with 'possible' values, then I am happy with that, but could not see one.

Anonymous
Not applicable

I see from your example that you want to create two variables containing Date Value, first and second, and there are always two(?).  There are other ways, for example:

v1 = date(min([Date Value]))

v2 = date(min([Date Value],2))

Or

v1 = date(FirstSortedValue([Date Value],[Date Value],1))

v2 = date(FirstSortedValue([Date Value],[Date Value],2))

You maybe need some conditions in case both dates are the same.

simonb2013
Creator
Creator
Author

Ok, so this looks interesting.

No, not always 2, could be up to 6 different values (I'm limiting to 6 on 'reasonable grounds')

'FirstSortedValue' with the rank argument might do the trick.

I'll defo mark as helpful, will come back after a play for more feedback