Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have 2 different tables in which I have information about 3 Plants. Unfortunately, each Plant uses a different logic for the connection between the 2 tables like below (the names are the field names):
Plant | Table 1 | Table 2 |
A | Reference No | Tracking ID |
B | Sub Ref No | Tracking ID |
C | Sub Ref No | Loading ID |
What I tried to do is to use 'if' statements in each load script to rename the fields to a common field based on the Plant condition. Something like below.
Table 1:
If(Plant='A', "Reference No" = TableKey,
If(Plant='B' or Plant='C', "Sub ref no" = TableKey))
Table 2:
If(Plant='A' or Plant='B', "Tracking ID" = TableKey,
If(Plant='C', "Loading ID" = TableKey))
I am not sure this is the right logic to get these things done. In addition, when trying to load the scripts, Qlik Sense gives the error that Field 'TableKey' not found.
Any help is appreciated! Thanks!
I think the general logic is right but not the syntax and only one if will be needed. Try something like this:
Table 1:
If(Plant='A', "Reference No", "Sub ref no") as TableKey
Table 2:
If(Plant='C', "Loading ID", "Tracking ID") as TableKey
- Marcus
I think the general logic is right but not the syntax and only one if will be needed. Try something like this:
Table 1:
If(Plant='A', "Reference No", "Sub ref no") as TableKey
Table 2:
If(Plant='C', "Loading ID", "Tracking ID") as TableKey
- Marcus