Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hallo Community,
i have a Scripting Problem and am searching for help.
my data structure looks like that:
Column A, Column B, Column C
1, 0, 99
2, 1, 999
3, 4, 9
4, 6, 9999
5, 2, 99999
within the script I want to:
Load
Column A,
"search for value in of column A in column B and return the value of column C" as Value
From xxx;
The Table in my App should look like:
Column A, Value
1, 999
2, 99999
3,
4,
5,
Thanks for any help in advance!!
Chris
Chris, I'd do it by mapping. First, create map:
Mapping:
MAPPING LOAD DISTINCT
B,
C
FROM InitialData;
Next, use applymap:
Result:
LOAD
A,
applymap('Mapping', A, null()) as C
FROM InitialData;
Chris, I'd do it by mapping. First, create map:
Mapping:
MAPPING LOAD DISTINCT
B,
C
FROM InitialData;
Next, use applymap:
Result:
LOAD
A,
applymap('Mapping', A, null()) as C
FROM InitialData;
MapTable:
Mapping Load B as A,C From xxx;
LOAD A, ApplyMap('MapTable', A, null()) as C
From xxx;
Renaming B to A to have same column name, that's how mapping load works. ID column to match and the column to be retrieved
null() is the value to assign if there's no match
Mapping load doesn't really care about field names. The first field is searched and the second one is the result.
oh I see, thanks for the clarification, regards!
hey guys, that sounds as a good idea, i try it out and then i ll give Feedback, hope it works,
thank you in advance
Thanks to all. Solution works. Since i want to map more than one column in my original file, i do it with a join... works very well!!!
Ty all, again.