Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In simple terms, on my 'home' tab, I want users to select from one of two list boxes :
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
Category | Date Value | Date Number |
A | 01/01/2017 | 1 |
A | 02/01/2017 | 2 |
A | 03/01/2017 | 3 |
B | 01/01/2017 | 1 |
B | 13/02/2017 | 2 |
B | 13/03/2017 | 3 |
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.)
.. 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.
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.
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