Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ditshele
Contributor
Contributor

Creating Key that will be linked to 2 fields in the table

Good day

 

Please assist,I have two fields branch1 and Branch2 i would like to make a selection from another field that will produce the results of data associated with the selected branch on both branches.

 

e.g see below example,if i select branch=1,i would like to see everything associated with Branch =1 on both Branch1 and Branch2 fields.

 

 

Ditshele_0-1647327380484.png

 

 

 

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Such problems are best solved by creating a data model that represents the logic you want; i.e. you need to change the script. In your example, the solution is probably to create a third field "Branch" that contains the values of both "Branch1" and "Branch2":

Load <SomeAppropriateKey>, Branch1 as Branch Resident ...
Load <SomeAppropriateKey>, Branch2 as Branch Resident ...

See also https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578 where a similar problem for dates is solved this way.

HIC

View solution in original post

2 Replies
hic
Former Employee
Former Employee

Such problems are best solved by creating a data model that represents the logic you want; i.e. you need to change the script. In your example, the solution is probably to create a third field "Branch" that contains the values of both "Branch1" and "Branch2":

Load <SomeAppropriateKey>, Branch1 as Branch Resident ...
Load <SomeAppropriateKey>, Branch2 as Branch Resident ...

See also https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578 where a similar problem for dates is solved this way.

HIC

Ditshele
Contributor
Contributor
Author

It works perfectly.T hanks!