<?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: Text as a column in nested applymap in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601213#M444307</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6843"&gt;@qliksus&lt;/a&gt;&amp;nbsp; - i tried it but it did not work.&amp;nbsp; I think it is unable to recognize it a column.&amp;nbsp; It is recognizing it as text and it is not working.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jul 2019 07:07:06 GMT</pubDate>
    <dc:creator>sjhussain</dc:creator>
    <dc:date>2019-07-11T07:07:06Z</dc:date>
    <item>
      <title>Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601103#M444288</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to build a key value using applymap.&lt;/P&gt;&lt;P&gt;What we want to do is to pass the result of one applymap which would be a column name into another applymap.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried it but it seems like it is not understanding that the result of the applymap.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ApplyMap('MAP_THRESHOLD1_SYNDROME',ShortName,Null()) returns "REGIONS" which is a column name and i want to use the value in the REGIONS column to be passed into the MAP_THRESHOLD1_CODE applymap.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ShortName &amp;amp; '-' &amp;amp; applymap('MAP_THRESHOLD1_CODE',&lt;STRONG&gt;ApplyMap('MAP_THRESHOLD1_SYNDROME',ShortName,Null())&lt;/STRONG&gt;,'n/a') &amp;amp; '-' &amp;amp;&lt;BR /&gt;ApplyMap('MAP_Threshold3_CASES',ShortName,Null()) AS KEY_CASES,&lt;/P&gt;&lt;P&gt;How would i do that?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 20:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601103#M444288</guid>
      <dc:creator>sjhussain</dc:creator>
      <dc:date>2019-07-10T20:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601129#M444294</link>
      <description>&lt;P&gt;Hi, if there are not many fields you try changing it to a nested if or pick(match(:&lt;/P&gt;&lt;P&gt;Pick(Match(ApplyMap('MAP_THRESHOLD1_SYNDROME',ShortName,Null()), 'REGIONS, 'COUNTRIES')&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;SPAN&gt;applymap('MAP_THRESHOLD1_CODE', REGIONS,'n/a')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;SPAN&gt;applymap('MAP_THRESHOLD1_CODE', COUNTRIES,'n/a')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 21:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601129#M444294</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-07-10T21:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601135#M444295</link>
      <description>&lt;P&gt;You can try 'preceding load' to allow the first ApplyMap to process before applying the other.&lt;/P&gt;&lt;P&gt;Here's an example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Countries:
Mapping
Load * Inline [
	City, Country
	Brussels, Belgium
	Amsterdam, Netherlands
	Frankfurt, Germany
	Berlin, Germany
	Cairo, Egypt
	Rome, Italy
	Milan, Italy
	Lagos, Nigeria
	Bamako, Mali
];

Continents:
Mapping
Load * Inline [
	Country, Continent
	Belgium, Europe
	Netherlands, Europe
	Germany, Europe
	Egypt, Africa
	Italy, Europe
	Nigeria, Africa
	Mali, Africa
];


load
	*,
	ApplyMap('Continents', Country, 'Other Continent') as Continent
;

load 
	*,
	ApplyMap('Countries', City, 'Other Country') as Country
;

Data:
Load * Inline [
	ID,City
	2,Berlin
	3,Prague
	4,Cairo
	5,Brussels
	6,Rome
	7,Milan
	8,Lagos
	9,Bamako
];	&lt;/LI-CODE&gt;&lt;P&gt;The output is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QV_Sample_7.png" style="width: 232px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15252i361608FAE6F90FBF/image-size/large?v=v2&amp;amp;px=999" role="button" title="QV_Sample_7.png" alt="QV_Sample_7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But you can opt to load specific fields instead of "*" in the preceding load OR just drop the columns after.&amp;nbsp;&lt;/P&gt;&lt;P&gt;J.&lt;/P&gt;&lt;P&gt;Oops...I forgot to map Prague.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 21:26:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601135#M444295</guid>
      <dc:creator>jwaligora</dc:creator>
      <dc:date>2019-07-10T21:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601177#M444300</link>
      <description>&lt;P&gt;Maybe use a precedent load&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;* ,&lt;/P&gt;&lt;P&gt;ShortName &amp;amp; '-' &amp;amp; applymap('MAP_THRESHOLD1_CODE',region,'n/a') &amp;amp; '-' &amp;amp;&lt;BR /&gt;ApplyMap('MAP_Threshold3_CASES',ShortName,Null()) AS KEY_CASES,&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ApplyMap('MAP_THRESHOLD1_SYNDROME',ShortName,Null())&lt;/STRONG&gt; as region&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FRom table ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 04:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601177#M444300</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2019-07-11T04:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601211#M444305</link>
      <description>&lt;P&gt;Rubenmarin,&lt;/P&gt;&lt;P&gt;Initially i have the following dimensions:&lt;/P&gt;&lt;P&gt;REGION/NATIONALITY/GENDER which might also change.&amp;nbsp; Your solutions looks feasible.&amp;nbsp; Instead of pick match is there a way we can have it dynamically rather than hardcoding the dimension names?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 07:04:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601211#M444305</guid>
      <dc:creator>sjhussain</dc:creator>
      <dc:date>2019-07-11T07:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601212#M444306</link>
      <description>&lt;P&gt;Jwaligora,&lt;/P&gt;&lt;P&gt;we wanted dynamic loading of column names and then get the value of it.&amp;nbsp; The example you provided is hardcoded column names.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 07:05:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601212#M444306</guid>
      <dc:creator>sjhussain</dc:creator>
      <dc:date>2019-07-11T07:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601213#M444307</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6843"&gt;@qliksus&lt;/a&gt;&amp;nbsp; - i tried it but it did not work.&amp;nbsp; I think it is unable to recognize it a column.&amp;nbsp; It is recognizing it as text and it is not working.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 07:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601213#M444307</guid>
      <dc:creator>sjhussain</dc:creator>
      <dc:date>2019-07-11T07:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601225#M444309</link>
      <description>&lt;P&gt;Hi, I don't see how to make this dynamic, I tried and it always use the value retrieved as text, not as a field name, maybe other users comes with that idea.&lt;/P&gt;&lt;P&gt;To have it a bit more centralized you can use variables:&lt;/P&gt;&lt;P&gt;SET vField1 =&amp;nbsp;REGIONS;&lt;/P&gt;&lt;P&gt;SET vField2 = &lt;SPAN&gt;NATIONALITY&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;SET vField3 = &lt;SPAN&gt;GENDER&amp;nbsp;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pick(Match(ApplyMap('MAP_THRESHOLD1_SYNDROME',ShortName,Null()), '$(vField1)', '$(vField2)', '$(vField3)')&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;SPAN&gt;applymap('MAP_THRESHOLD1_CODE', $(vField1),'n/a')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;SPAN&gt;applymap('MAP_THRESHOLD1_CODE', $(vField2),'n/a')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; ,applymap('MAP_THRESHOLD1_CODE', $(vField3),'n/a')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe knowing the requierements you can reach a formula to fill vField1, vField2... and even doing a bucle to create the "pick(Match(" syntax from a list of fields, if neccesary I can take a look when I have more free time than now.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 07:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601225#M444309</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-07-11T07:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Text as a column in nested applymap</title>
      <link>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601512#M444383</link>
      <description>&lt;P&gt;I was clearly slow on the uptake, so I'm gonna try again using Rubenmarin's response as the foundation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below takes its cue from the&amp;nbsp;&lt;SPAN&gt;MAP_THRESHOLD1_SYNDROME map, where the output Column Names can vary both in count and in value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/* 
This is an equivalent to the MAP_THRESHOLD1_SYNDROME, fist loaded as a Table 
and later transformed into a Map, once extraction of pertinent variables is complete.
*/
ColNamesTab:
Load * Inline [
	SomeFld,ColName
	A, Gender
	B, Nationality
	C, Region
	D, Region
	E, Region
	F, Gender
];

/*
Exctraction of strings to be stored in variables
*/
StringsTab:
Load 
	CONCAT(DISTINCT '''' &amp;amp; ColName &amp;amp; '''' , ',') as ColNamesString,
	CONCAT(DISTINCT 'applymap(''ColValMap'',' &amp;amp; ColName &amp;amp;' ,''n/a'')',',') as MapsListString 
resident ColNamesTab;

/*
Storing of strings into vars
*/
Let vColNames = Peek('ColNamesString') ;
TRACE $(vColNames);

Let vMapsList = Peek('MapsListString') ;
TRACE $(vMapsList);

/*
Turn the Table into the desired Map (aka MAP_THRESHOLD1_SYNDROME)
*/
ColNamesMap:
Mapping
Load distinct * resident ColNamesTab;

/*
Get rid of things no longer needed
*/
Drop Table ColNamesTab;
Drop Table StringsTab;

/*
Create 2nd level map (aka MAP_THRESHOLD1_CODE)
using simplistic values for easy validation
*/
ColValMap:
Mapping
Load * Inline [
	Val, Output
	G, Mapped Gender
	R, Mapped Region
	N, Mapped Nationality
];

/*
Load in the actual data.
*/
Data:
Load * inline [
	ID, SomeFld, Gender, Region, Nationality
	1, A, G, R, N
    2, B, G, R, N
    3, F, G, R, N
    4, E, G, R, N
    5, D, G, R, N
];
 
/*
Transform the data to include the mappings
*/ 
MappedData:
Load distinct
	ID as Record,
	SomeFld as Reference,
	Pick(Match(ApplyMap('ColNamesMap',SomeFld, Null()), $(vColNames))
		, $(vMapsList)
	) as FinalVals
Resident Data
;&lt;/LI-CODE&gt;&lt;P&gt;Output...&lt;/P&gt;&lt;P&gt;Based on&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ColNamesTab:
Load * Inline [
	SomeFld,ColName
	A, Gender
	B, Nationality
	C, Region
	D, Region
	E, Region
	F, Gender
];&lt;/LI-CODE&gt;&lt;P&gt;and the original data table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QV_Sample_11.png" style="width: 239px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15303i156FE77A9F4D9AF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="QV_Sample_11.png" alt="QV_Sample_11.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It outputs:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QV_Sample_12.png" style="width: 248px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/15304i08A6E7B2BE8263EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="QV_Sample_12.png" alt="QV_Sample_12.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In case I'm still off the mark, maybe at the very least this will provide some additional ideas to work with.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;J.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 16:30:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Text-as-a-column-in-nested-applymap/m-p/1601512#M444383</guid>
      <dc:creator>jwaligora</dc:creator>
      <dc:date>2019-07-11T16:30:13Z</dc:date>
    </item>
  </channel>
</rss>

