4 Replies Latest reply: Jul 18, 2017 10:03 AM by simon bushell RSS

    Synchronizing 2 field filters

    simon bushell

      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

        • Re: Synchronizing 2 field filters
          Michael Solomovich

          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.)

            • Re: Synchronizing 2 field filters
              simon bushell

              .. 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.

               

                • Re: Synchronizing 2 field filters
                  Michael Solomovich

                  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.