Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I was wondering if it was possible to have an if/then statement based on two different files.
I want a field from File A to interact with a field from File B in the script within an if/then statement.
Ex:
if (CW < [SW FSS], 'Low Avail', 'NONE') as Codes
LOAD
[Part number],
QW,
CW,
FROM
[\\Blah.xls]
(ooxml, embedded labels, header is 1 lines, table is Report1);
LOAD
Plant,
[SW FSS)]
FROM
[\\1234ABCD.xls]
(ooxml, embedded labels, header is 11 lines, table is Table);
Can someone help?
Try this.
Data:
Load *, If ( [AvailCW2]< [SW FSS], 'Low CW Avail', 'NONE') as [Codes];
LOAD
[Part number],
[SW FSS)],
ApplyMap('Linking', [Part number], 'Null') as [AvailCW2]
FROM
[\\1234ABCD.xls]
(ooxml, embedded labels, header is 11 lines, table is Table);
Try to club in single Table using ApplyMap() and then use same condition ?
You will need to somehow Join (using Joins or apply map or lookup) bring the two fields into a single table and only then you would be able to perform your calculation
So I completed the Apply Map function, but I need to also include an IF statement.
Ex: IF (CW < [SW FSS], 'Low Avail', 'NONE') as Codes
So so far I have my code as:
Linking:
Mapping LOAD
[Part number],
CW,
FROM
[\\Blah.xls]
(ooxml, embedded labels, header is 1 lines, table is Report1);
Data:
LOAD
[Part number],
[SW FSS)],
ApplyMap('Linking', [Part number], 'Null') as [AvailCW2]
FROM
[\\1234ABCD.xls]
(ooxml, embedded labels, header is 11 lines, table is Table);
I need the new field [AvailCW2] to have an if statement that references a second field [Codes].
If (([AvailCW2]< "[SW FSS]"), 'Low CW Avail', 'NONE') as [Codes]
Try this.
Data:
Load *, If ( [AvailCW2]< [SW FSS], 'Low CW Avail', 'NONE') as [Codes];
LOAD
[Part number],
[SW FSS)],
ApplyMap('Linking', [Part number], 'Null') as [AvailCW2]
FROM
[\\1234ABCD.xls]
(ooxml, embedded labels, header is 11 lines, table is Table);
Thank you, thank you, thank you soooo much!
That worked perfect!!