<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find matching column name with column value in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582747#M3963</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;To do that, you can use the mapping tables. Try this following code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Data Table]:
LOAD * Inline [
HH_AGE,HH_CHILD
0,0
1,2
2,1
3,9
];


[Discription Table]:
LOAD * Inline [
FIELDNAME,CODE,DISCRIPTION
HH_AGE,0,YOUNG
HH_AGE,1,SEMI-YOUNG
HH_AGE,2,TEEN
HH_AGE,3,GROWN-TEEN
HH_CHILD,0,FEW
HH_CHILD,1,MORE_FEW
HH_CHILD,2,EXPECTED
HH_CHILD,9,A_LOT
];

// MAPPING TABLES
MAP_HH_AGE:
MAPPING 
LOAD
	CODE,
    DISCRIPTION
RESIDENT [Discription Table]
WHERE FIELDNAME = 'HH_AGE'
;

MAP_HH_CHILD:
MAPPING 
LOAD
	CODE,
	DISCRIPTION
RESIDENT [Discription Table]
WHERE FIELDNAME = 'HH_CHILD'
;


NoConcatenate
Result:
LOAD
	Applymap('MAP_HH_AGE',HH_AGE,'')   AS HH_AGE,
	Applymap('MAP_HH_CHILD',HH_CHILD,'') AS HH_CHILD
RESIDENT [Data Table];

DROP TABLES
[Discription Table],
[Data Table];&lt;/LI-CODE&gt;&lt;P&gt;cordially.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 13:01:49 GMT</pubDate>
    <dc:creator>Seyko</dc:creator>
    <dc:date>2019-05-21T13:01:49Z</dc:date>
    <item>
      <title>Find matching column name with column value</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582720#M3959</link>
      <description>&lt;P&gt;Im breaking my head over this and can't find a solution although it looks simple (I thought).&lt;/P&gt;&lt;P&gt;I have two tables one table that contains the columns and headers and the other contains the descriptions of the codes which you can find under the corresponding column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think an example would be more in its place here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Data Table]:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;HH_AGE, HH_CHILD&lt;BR /&gt;0,0&lt;BR /&gt;1,2&lt;BR /&gt;2,1&lt;BR /&gt;3,9&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[Discription Table]:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;FIELDNAME,CODE,DISCRIPTION&lt;BR /&gt;HH_AGE,0,YOUNG&lt;BR /&gt;HH_AGE,1,SEMI-YOUNG&lt;BR /&gt;HH_AGE,2,TEEN&lt;BR /&gt;HH_AGE,3,GROWN-TEEN&lt;BR /&gt;HH_CHILD,0,FEW&lt;BR /&gt;HH_CHILD,1,MORE_FEW&lt;BR /&gt;HH_CHILD,2,EXPECTED&lt;BR /&gt;HH_CHILD,9,A_LOT&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what I try to get is a new table where the codes in the data table are replaced by the discription in the discription table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that would look like this:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;BR /&gt;HH_AGE, HH_CHILD&lt;BR /&gt;YOUNG,FEW&lt;BR /&gt;SEMI-YOUNG,EXPECTED&lt;BR /&gt;TEEN,MORE_FEW&lt;BR /&gt;GROWN-TEEN,A_LOT&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is manageable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 19:33:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582720#M3959</guid>
      <dc:creator>Dewiatqlik</dc:creator>
      <dc:date>2021-12-28T19:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find matching column name with column value</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582747#M3963</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;To do that, you can use the mapping tables. Try this following code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Data Table]:
LOAD * Inline [
HH_AGE,HH_CHILD
0,0
1,2
2,1
3,9
];


[Discription Table]:
LOAD * Inline [
FIELDNAME,CODE,DISCRIPTION
HH_AGE,0,YOUNG
HH_AGE,1,SEMI-YOUNG
HH_AGE,2,TEEN
HH_AGE,3,GROWN-TEEN
HH_CHILD,0,FEW
HH_CHILD,1,MORE_FEW
HH_CHILD,2,EXPECTED
HH_CHILD,9,A_LOT
];

// MAPPING TABLES
MAP_HH_AGE:
MAPPING 
LOAD
	CODE,
    DISCRIPTION
RESIDENT [Discription Table]
WHERE FIELDNAME = 'HH_AGE'
;

MAP_HH_CHILD:
MAPPING 
LOAD
	CODE,
	DISCRIPTION
RESIDENT [Discription Table]
WHERE FIELDNAME = 'HH_CHILD'
;


NoConcatenate
Result:
LOAD
	Applymap('MAP_HH_AGE',HH_AGE,'')   AS HH_AGE,
	Applymap('MAP_HH_CHILD',HH_CHILD,'') AS HH_CHILD
RESIDENT [Data Table];

DROP TABLES
[Discription Table],
[Data Table];&lt;/LI-CODE&gt;&lt;P&gt;cordially.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582747#M3963</guid>
      <dc:creator>Seyko</dc:creator>
      <dc:date>2019-05-21T13:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find matching column name with column value</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582795#M3966</link>
      <description>&lt;P&gt;Woow really thanks! I've been looking for ages for this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it's time to master the mapping function &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetz&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:32:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Find-matching-column-name-with-column-value/m-p/1582795#M3966</guid>
      <dc:creator>Dewiatqlik</dc:creator>
      <dc:date>2019-05-21T13:32:59Z</dc:date>
    </item>
  </channel>
</rss>

