Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

use getfieldselections to assign multiple values to another field

Hi guys,

i have 2 fields journey_type and bm_journey type.

whenever a user select value/values in journey type, i want the same values to be selected in bm_journey type.

All is well when only one value need to be assigned.

but when multiple value is selected in field, it is not working

i used both triggers and macro

Trigger : for journey type-> on select and change -> select in field -> bm journey_type -> getfieldselections(journey_type)

and in MACRO as follows...

ActiveDocument.Fields("bm_journey_type").Select ActiveDocument.Evaluate("Getfieldselections(journey_type)"), True

please suggest whats wrong or some alternate methods to achieve this.

5 Replies
fernando_tonial
Employee
Employee

hi, you can try in your trigger.

Select in field = bm_journey type

='('& Concat(getfieldselections(journey_type),'|') &')'

The result is:

(Value1|Value2|Value3)

Best Regards.

Tonial.

Don't Worry, be Qlik.
jfkinspari
Partner - Specialist
Partner - Specialist

You can achieve this by expression level by utilizing set analysis

sum({$<bm_journey type = journey_type >} FieldToSum)

It requires that at least one value is selected in journey_type

lironbaram
Partner - Master III
Partner - Master III

hi attach is an example

Not applicable
Author

Hi i tried this code,

it works for single values but not for multiple values.

also my use of this function is to compare two set of tables , of which one has journey_type and one set of values and the other having bm_journey_type.

And each of fields can have 3 distinct values one_way, r_trip and multi_city

in your code also, when only one is selected, the values are selected in bm_journey_type,

but when 2 of them say oneway and rtrip are selected, its not working,

any modificaitons???

fernando_tonial
Employee
Employee

Sorry, remove de function getfieldselections().

='('& Concat(journey_type,'|') &')'

Best Regards.

Tonial.

Don't Worry, be Qlik.