Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Search for equal field in other column

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

1 Solution

Accepted Solutions
Highlighted
Champion III
Champion III

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;

View solution in original post

6 Replies
Highlighted
Champion III
Champion III

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;

View solution in original post

Highlighted
Creator III
Creator III

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

Highlighted
Not applicable

Mapping load doesn't really care about field names. The first field is searched and the second one is the result.

Highlighted
Creator III
Creator III

oh I see, thanks for the clarification, regards!

Partner
Partner

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

Highlighted
Partner
Partner

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.