<?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 Mapping in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206064#M62318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aloah,&lt;/P&gt;&lt;P&gt;You could also try to solve this with the replace function. I use a textobject to indicate which active selections have been made. I therefor use an inline table in the script:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Fieldname:&lt;BR /&gt;&lt;/EM&gt; &lt;EM&gt;LOAD * INLINE [&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;String, To&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Test.Field, Myalternativefieldname&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In my textobject i use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=replace(getcurrentselections(),Fieldname.String,Fieldname.To)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Now when users make a selection in Test.Field, my textobject will show the parameters as &lt;EM&gt;Myalternativefieldname: &amp;lt;parameters&amp;gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I hope this is usefull to you.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick Tehubijuluw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 May 2010 13:20:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-05-28T13:20:27Z</dc:date>
    <item>
      <title>Mapping in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206059#M62313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello *,&lt;/P&gt;&lt;P&gt;is it possible to do a mapping in an expression. My formula returns eg. value 1 to 25.&lt;BR /&gt;I'd like to do the mapping inside the expression not in the script.&lt;/P&gt;&lt;P&gt;Mapping table would look like this:&lt;/P&gt;&lt;P&gt;Map:&lt;BR /&gt;1, AA&lt;BR /&gt;2, AB&lt;BR /&gt;3, AX&lt;BR /&gt;....&lt;BR /&gt;25, TR&lt;/P&gt;&lt;P&gt;Tried with mapping without success &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;BR /&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 15:02:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206059#M62313</guid>
      <dc:creator />
      <dc:date>2010-04-07T15:02:27Z</dc:date>
    </item>
    <item>
      <title>Mapping in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206060#M62314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mapping tables are discarded at the end of the load, so you can't use them, and so you can't use applymap() to do this, even though it seems like the obvious solution. If Map is a regular table... I'm still not thinking of a good way to do it.&lt;/P&gt;&lt;P&gt;I am thinking of a &lt;EM&gt;bad&lt;/EM&gt; way to do it, though, assuming you want to stick with editing a table and not an expression. Use a loop during the script to create a string like this and assign it to variable vMap:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;pick($1,'AA','AB','AX',...,'TR')&lt;/P&gt;&lt;P&gt;Untested, but the script might look something like this (assuming your Map table is already loaded, was loaded in numeric sequence, no sequence values are skipped, and the resulting text is in field "Text"):&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET vMap='pick($1';&lt;BR /&gt;FOR I = 0 TO noofrows('Map')-1&lt;BR /&gt; LET vMap = vMap &amp;amp; ',' &amp;amp; chr(39) &amp;amp; peek('Text',I,'Map') &amp;amp; chr(39)&lt;BR /&gt;NEXT I&lt;BR /&gt;LET vMap = vMap &amp;amp; ')';&lt;/P&gt;&lt;P&gt;Then $(vMap(your formula)) should return the text corresponding to the number. If we're lucky.&lt;/P&gt;&lt;P&gt;There's almost certainly a cleaner, easier way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 00:49:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206060#M62314</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-08T00:49:21Z</dc:date>
    </item>
    <item>
      <title>Mapping in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206061#M62315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't try what I'm going to suggest, but hope it will work...&lt;/P&gt;&lt;P&gt;1. Create logical island, a table you'll use for mapping, but a permanent one:&lt;BR /&gt;A, B&lt;BR /&gt;1, AA&lt;BR /&gt;2, AB&lt;BR /&gt;3, AX&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;2. Use expression with set analysis on the front end:&lt;BR /&gt;only(${&amp;lt;A=${=your exprerssion}&amp;gt;}, B)&lt;BR /&gt;(There could be syntax nuances I can't predict here)&lt;/P&gt;&lt;P&gt;3. Let us know if it works... &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 04:06:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206061#M62315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-08T04:06:23Z</dc:date>
    </item>
    <item>
      <title>Mapping in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206062#M62316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, ?olleagues.&lt;/P&gt;&lt;P&gt;I tested this approach (suggested by Michael). and I was very surprised, but it works (with small modifications in SET expression) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;see in attachment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 08:27:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206062#M62316</guid>
      <dc:creator>sparur</dc:creator>
      <dc:date>2010-04-08T08:27:37Z</dc:date>
    </item>
    <item>
      <title>Mapping in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206063#M62317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, but it only works if you have a single company selected. Set analysis is only evaluated once for the whole chart, not once for each row, causing the problem.&lt;/P&gt;&lt;P&gt;But that DOES imply that you could do it with a logical island and an IF:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;only(if(A=your expression,B))&lt;/P&gt;&lt;P&gt;It works just fine.&lt;/P&gt;&lt;P&gt;But now I'm curious, since I don't have to make my own sample file. Yep, my approach worked just as written, once I added the missing semicolon at the end of the LET statement.&lt;/P&gt;&lt;P&gt;The only(if()) approach seems a lot better than mine, though, so that's what I'd use. It's also more robust, because it doesn't require that your mapping table be in sequential order and not skip any numbers. For that matter, it can be used with any sort of mapping, not just an integer to text map. All three approaches can be seen in the attached file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 17:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206063#M62317</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-08T17:39:10Z</dc:date>
    </item>
    <item>
      <title>Mapping in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206064#M62318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aloah,&lt;/P&gt;&lt;P&gt;You could also try to solve this with the replace function. I use a textobject to indicate which active selections have been made. I therefor use an inline table in the script:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Fieldname:&lt;BR /&gt;&lt;/EM&gt; &lt;EM&gt;LOAD * INLINE [&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;String, To&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Test.Field, Myalternativefieldname&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In my textobject i use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=replace(getcurrentselections(),Fieldname.String,Fieldname.To)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Now when users make a selection in Test.Field, my textobject will show the parameters as &lt;EM&gt;Myalternativefieldname: &amp;lt;parameters&amp;gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I hope this is usefull to you.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick Tehubijuluw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 May 2010 13:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-in-expression/m-p/206064#M62318</guid>
      <dc:creator />
      <dc:date>2010-05-28T13:20:27Z</dc:date>
    </item>
  </channel>
</rss>

