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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Mapping extract column names and values

Hi,

 

I have a database table that contains a number of columns that I ned to extract to a csv file. During the extract process I need to dynamically alter some of the column names and values based on a mapping table that I've built. 

 

Example input (database)

col1 col2 col3

a b c
a b d
a e c

 

And after being mapped the output should look something like

ID Name col3

a bar c
a bar d
a egg c

 

I'm using Talent open studio so the dynamic schema components are not available to me . Any suggestions on how I can achieve this? I have done something similar previously however that data was pivoted so that the column names and values were obtained in the data and I could use a tmap to do the mapping

e.g

ID Attribute Value

a col2 b
a col3 d

 

 

Labels (3)
4 Replies
vapukov
Master II
Master II

connect to tMap

- main table with main connection

- lookup table with lookup

use LEFT join by to columns:

- col1 == id

- col3 == value

 

map to output

- col1, col3 from main table

- attribute from lookup table

Anonymous
Not applicable
Author

Hi @vapukov thanks for the quick reply. The problem is I need to map the column names dynamically as well, not just the values. My mapping table specifies old and new names for columns so col1 = ID etc. I don't think I can achieve that through a tmap

vapukov
Master II
Master II

yes, you can not ...

 

first of all -dynamic schema - do not help you as well 0683p000009MACn.png

 

but, you could:

- redesign schema for more appropriate (if you can)

- use sql for achive what you need - both tables in database (even if it different databases - first step land data to the same database staging table), then use SQL for return mapped data (tSQLinput support any query, bot only table)

Anonymous
Not applicable
Author

Thanks @vapukov Yes, I'm thinking I need to do this in the db and then Talend can handle the results. I guess I posted to see if there were any components to do this in Talend