<?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: Calling dynamically a MapSubString table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1758482#M58595</link>
    <description>&lt;P&gt;Thanks Marcus! I made something like this and it worked.&lt;/P&gt;&lt;P&gt;Thanks to all for your responses also !&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 15:28:29 GMT</pubDate>
    <dc:creator>kcollorig</dc:creator>
    <dc:date>2020-11-04T15:28:29Z</dc:date>
    <item>
      <title>Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749706#M57669</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I'm trying to call the&amp;nbsp;MapSubString&amp;nbsp; function dynamically within a load statement but it is not working...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Mapsubstring_Table1:
MAPPING LOAD * INLINE [
From, To
Value_1, Value_2
];
Mapsubstring_Table2:
MAPPING LOAD * INLINE [
From, To
Value_3, Value_4
];

Table_Raw:
LOAD * INLINE [
Value, MappingTable
Value1, Table1
Value3, Table2
];

Table_Mapped:
LOAD *,
MapSubString('Mapsubstring_' &amp;amp; MappingTable, Value) AS Value_Mapped
RESIDENT Table_Raw;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dynamic call of the Mapping tables thanks to the MappingTable field does not work... I have the error '&lt;STRONG&gt;MapSubString function takes a constant map as first parameter&lt;/STRONG&gt;'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note that above is just a simple example and that in my case I need to have multiple mapping tables... Any idea ?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:00:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749706#M57669</guid>
      <dc:creator>kcollorig</dc:creator>
      <dc:date>2024-11-16T18:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749711#M57671</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127177"&gt;@kcollorig&lt;/a&gt;&amp;nbsp;I am not sure if it will work like this, you might have to use an if statement or pick match to have multiple mapsubstrings&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 18:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749711#M57671</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-10-05T18:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749747#M57676</link>
      <description>&lt;P&gt;Thanks for your answer! Unfortunately I have too many mapping tables to do this...&lt;/P&gt;&lt;P&gt;In fact what I'm trying to do is to make a substring map depending on the value of two other fields. Maybe you would have another idea on how to do this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 20:38:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749747#M57676</guid>
      <dc:creator>kcollorig</dc:creator>
      <dc:date>2020-10-05T20:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749759#M57679</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127177"&gt;@kcollorig&lt;/a&gt;&amp;nbsp;You can map single field value using multiple mapping table. Also you can map multiple fields using multiple mapping tables but you need to write multiple mapsubstring function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your mapping tables are having same field name then they will autoconcatenate and then you can use single mapsubsrting statement if you want to map single field or you can use multiple mapsubstring.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mapsubstring_Table&lt;/STRONG&gt;:&lt;BR /&gt;MAPPING LOAD * INLINE [&lt;BR /&gt;&lt;STRONG&gt;From, To&lt;/STRONG&gt;&lt;BR /&gt;Value_1, Value_2&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;MAPPING LOAD * INLINE [&lt;BR /&gt;&lt;STRONG&gt;From, To&lt;/STRONG&gt;&lt;BR /&gt;Value_3, Value_4&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;MAPPING LOAD * INLINE [&lt;BR /&gt;&lt;STRONG&gt;From, To&lt;/STRONG&gt;&lt;BR /&gt;Other_1, Other_2&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Table_Raw:&lt;BR /&gt;LOAD *,MapSubString('&lt;STRONG&gt;Mapsubstring_Table&lt;/STRONG&gt;', &lt;STRONG&gt;Value&lt;/STRONG&gt;) as Map_Value,&lt;BR /&gt;MapSubString('&lt;STRONG&gt;Mapsubstring_Table&lt;/STRONG&gt;', &lt;STRONG&gt;Value2&lt;/STRONG&gt;) as Map_Value2&lt;BR /&gt;INLINE [&lt;BR /&gt;Value, MappingTable, Value2&lt;BR /&gt;Value_1, Table1, Other_1&lt;BR /&gt;Value_3, Table2, Other&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-10-05 224550.png" style="width: 412px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41745i24D0801C3B98FB85/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-10-05 224550.png" alt="Screenshot 2020-10-05 224550.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 21:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749759#M57679</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-05T21:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749856#M57694</link>
      <description>&lt;P&gt;Hi Kush, thanks for your answer. In fact I'm in a particular case and the example I gave do not represent it correctly... So I'll try to explain in details what I'm trying to achieve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data come from forms with free text areas as answers. So since the answers are not standard, I need to identify some words in it. For that, I created a vocabulary reference excel file that gives for each TYPE of form and each QUESTION, the words that I'm looking in the ANSWER.&lt;/P&gt;&lt;P&gt;For example I have these data :&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Form_Answers:
LOAD * INLINE [
Form_Type, Form_Question, Form_Answer
Type_1, Oject Lost ?, I didn't remember where I put my phone
Type_1, Oject Lost ?, I've lost my computer and phone
Type_2, Computer Brand ?, The brand of my Computer is HP
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what I want to do is this :&lt;/P&gt;&lt;LI-CODE lang="php"&gt;[Mapsubstring_Type_1_Object_Lost_?]:
MAPPING LOAD * INLINE [
From, To
computer, --&amp;gt; Computer &amp;lt;--
phone, --&amp;gt; Phone &amp;lt;--
tablet, --&amp;gt; Tablet &amp;lt;--

];

[Mapsubstring_Type_2_Computer_Brand_?]:
MAPPING LOAD * INLINE [
Toshiba, --&amp;gt; Toshiba &amp;lt;--
HP, --&amp;gt; HP &amp;lt;--
Asus, --&amp;gt; Asus &amp;lt;--
];

Form_Answers:
LOAD * INLINE [
Form_Type, Form_Question, Form_Answer
Type_1, Oject_Lost_?, I didn't remember where I put my phone
Type_1, Oject_Lost_?, I've lost my computer and phone
Type_2, Computer_Brand_?, The brand of my Computer is HP
];

Form_Answers_Mapped:
LOAD Distinct 
    Form_Type,
    Form_Question,
    TextBetween(Form_Answer_Mapped, '--&amp;gt;', '&amp;lt;--', IterNo()) AS Form_Answer_Standard
WHILE Not Isnull(TextBetween(Form_Answer_Mapped, '--&amp;gt;', '&amp;lt;--', IterNo()))
;
LOAD *,
	MapSubString('Mapsubstring_' &amp;amp; Form_Type &amp;amp; Form_Question, Form_Answer) AS Form_Answer_Mapped
RESIDENT Form_Answers;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note that I have a lot of form types and questions and that unlike the example above all my mapping tables are created &lt;STRONG&gt;dynamically&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe my approach is not the good one... If you have any idea ?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 08:27:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749856#M57694</guid>
      <dc:creator>kcollorig</dc:creator>
      <dc:date>2020-10-06T08:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749873#M57698</link>
      <description>&lt;P&gt;I think I would rather try to use just a single mapping - means at first concatenating all mapstring-areas into one table by differentiating their return-values, like:&lt;/P&gt;&lt;P&gt;[MapsubstringPrepare]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;From, To&lt;BR /&gt;computer, --&amp;gt; Computer &amp;lt;--&lt;BR /&gt;phone, --&amp;gt; Phone &amp;lt;--&lt;BR /&gt;tablet, --&amp;gt; Tablet &amp;lt;--&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;concatenate([MapsubstringPrepare])&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;From, To&lt;BR /&gt;Toshiba, -------&amp;gt; Toshiba &amp;lt;-------&lt;BR /&gt;HP, -------&amp;gt; HP &amp;lt;-------&lt;BR /&gt;Asus, -------&amp;gt; Asus &amp;lt;-------&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;With it you could fetch accurate those values per textbetween() you want. You mentioned that all the tables are dynamically created - I assume in some kind of loop, if yes, you could use the loop-counter to set the needed extra chars for the return values - maybe something like:&lt;/P&gt;&lt;P&gt;repeat(chr(1), [LOOPCOUNTER] /* $(LOOPCOUNTER)*/)&lt;/P&gt;&lt;P&gt;Beside this I assume that you will also need some cleaning and structuring of the free-text. This means including/excluding of certain chars with keepchar/purgechar(), for example any line-breaks, quotes, maybe numbers, chars above chr(255), multiple spaces ...&lt;/P&gt;&lt;P&gt;Further removing filler words like and, or, do, did, have, also, too ... and also separating&amp;nbsp;&amp;nbsp;adjective, verbs, nouns and so on - to classify the content (maybe also with mapsubstring). You may need this to get more context to the answers and maybe it leads into any kind of a word-cloud.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 09:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1749873#M57698</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-10-06T09:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calling dynamically a MapSubString table</title>
      <link>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1758482#M58595</link>
      <description>&lt;P&gt;Thanks Marcus! I made something like this and it worked.&lt;/P&gt;&lt;P&gt;Thanks to all for your responses also !&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 15:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calling-dynamically-a-MapSubString-table/m-p/1758482#M58595</guid>
      <dc:creator>kcollorig</dc:creator>
      <dc:date>2020-11-04T15:28:29Z</dc:date>
    </item>
  </channel>
</rss>

