Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Want to apply selection from one field to another similar field

I have a scenario where I have an integrated data model with 50+ tables. And I have one unrelated table, call it a data island.

In the integrated model I have columns like

Gender

Disability,

etc....

This data island has similar columns but with different names.

Gender_Sector

Disability_Sector

I've got list boxes for Gender, Disability.... Whatever selection I make in these fields I need to apply in the data island as well.

e.g. If 'Male' is selected in the 'Gender' listbox, I need to effect that selection in the field 'Gender_Sector'. Can anybody think of a solution? I am trying a few things not reaching where I want to.

Thanks,

Ram

1 Solution

Accepted Solutions
MVP
MVP

Re: Want to apply selection from one field to another similar field

Hi Ram,

Try like this

Gender field selection - trigger-> select in field Gender_Sector->Search String:


='(' & GetFieldSelections(Gender, '|') & ')'


Regards,

Jagan.

10 Replies
MVP
MVP

Re: Want to apply selection from one field to another similar field

Use Field Selection trigger. Like for Gender field selection - trigger-> select in field Gender_Sector->Search String: GetFieldSelection(Gender)

PFA

Not applicable

Re: Want to apply selection from one field to another similar field

Thanks tresesco. Looks like a perfect solution. I’ll try this now. Need to do few modifications to all three layers. ☺

Not applicable

Re: Want to apply selection from one field to another similar field

Hi Tresesco, Everything seemed work perfectly until I did a multiple selection. You can check in your example if you select both 'Male' and 'Female', it doesn't work. Can you kindly check?

Thanks,

Ram

sarvjeet
New Contributor III

Re: Want to apply selection from one field to another similar field

use getfieldselections(Gender) - Returns a string with the current selections in a field.

Not applicable

Re: Want to apply selection from one field to another similar field

it is actually GetFieldSelections...   Doesn't work....

MVP
MVP

Re: Want to apply selection from one field to another similar field

Hi Ram,

You have to form the selected values in this format and then use this in Search String:

(Male|Female)


Regards,

Jagan.

MVP
MVP

Re: Want to apply selection from one field to another similar field

Hi Ram,

Try like this

Gender field selection - trigger-> select in field Gender_Sector->Search String:


='(' & GetFieldSelections(Gender, '|') & ')'


Regards,

Jagan.

Not applicable

Re: Want to apply selection from one field to another similar field

Hi Jagan, This doesn't work if the value has a space in it.

MVP
MVP

Re: Want to apply selection from one field to another similar field

Hi Ram,

If you have spaces in values then try like this

='("' & GetFieldSelections(Gender, '"|"') & '")'

Regards,

Jagan.

Community Browser