<?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: Map Load If Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380698#M701748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you use a variable? e.g:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let v_map = ApplyMap('Map_DATASOURCE', THEVALUE);&lt;/P&gt;&lt;P&gt;if( '$(v_map)' = 'SuperUser', 'No' , '$(v_map)' ) as ENDUSEREDIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2012 09:54:34 GMT</pubDate>
    <dc:creator>kouroshkarimi</dc:creator>
    <dc:date>2012-08-24T09:54:34Z</dc:date>
    <item>
      <title>Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380696#M701746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have the following mapping load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if((ApplyMap('Map_DATASOURCE', THEVALUE)) = 'SuperUser','No') as ENDUSEREDIT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It simply takes 'THEVALUE' to the Map_DATASORCE, and then applies an if based on the returned value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value is 'SuperUser' put 'No' as the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have been trying to do is the else part. I have the formattin gbut can only match the value to another value. I would like to say "else, store the original returned vaule"... Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if((ApplyMap('Map_DATASOURCE', THEVALUE)) = 'SuperUser','No', ORIGINAL VALUE RETURNED FROM MAP) as ENDUSEREDIT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just do not know what ORIGINAL VALUE RETURNED FROM MAP should be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a feeling this would work but it is probably not good for performance as it does two mappings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if((ApplyMap('Map_DATASOURCE', THEVALUE)) = 'SuperUser','No',ApplyMap('Map_DATASOURCE', THEVALUE)) as ENDUSEREDIT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:47:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380696#M701746</guid>
      <dc:creator />
      <dc:date>2012-08-24T09:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380697#M701747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using an If Statement you would be better off to base it on the core data and just applymap where needed i.e. in your if statement use the original data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:54:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380697#M701747</guid>
      <dc:creator />
      <dc:date>2012-08-24T09:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380698#M701748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you use a variable? e.g:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let v_map = ApplyMap('Map_DATASOURCE', THEVALUE);&lt;/P&gt;&lt;P&gt;if( '$(v_map)' = 'SuperUser', 'No' , '$(v_map)' ) as ENDUSEREDIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:54:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380698#M701748</guid>
      <dc:creator>kouroshkarimi</dc:creator>
      <dc:date>2012-08-24T09:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380699#M701749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felim,&lt;/P&gt;&lt;P&gt;The original data is just an ID which does not help. The values I need are in the map table so the map part is a must, surely? ie, you take the ID, look it up in the map, then bring back the value. I then do the if on this value. - cannot see any other way to do this other than a join... which also does not really help for the if.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:10:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380699#M701749</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380700#M701750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kouroshkarimi,&lt;/P&gt;&lt;P&gt;This looks promising.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give this a go and let you know how I get on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:13:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380700#M701750</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380701#M701751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your misunderstanding my point, basically you would use the ID´s in your if statement rather than using an apply map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If (&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;THEVALUE&lt;/SPAN&gt; = 1 OR &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;THEVALUE&lt;/SPAN&gt; = 2,'No',&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;ApplyMap('Map_DATASOURCE', THEVALUE)) AS &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;ENDUSEREDIT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;This avoids mapping twice&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:19:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380701#M701751</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380702#M701752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm, dont seem to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do an if statement I need the values which can only come from grabbing via the map load. The values I need are not in the initial table hence the mapping load. The initial table only holds IDs. Not the values that I am interested in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do the if you suggest is not possible with the data...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the If(THEVALUE = 1 or THEVALUE = 2 cannot be done as THEVALUE is only ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this makes sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380702#M701752</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380703#M701753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kouroshkarimi,&lt;/P&gt;&lt;P&gt;Having trouble adding the variable to the script. Have not dont this part before and cannot find where to add this to qv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am on version 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380703#M701753</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380704#M701754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No that makes no sense, you have the data infront of you.&amp;nbsp; Doing it the way Kourosh is saying is basically doing what you have done but means you have to type less..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically Apply Map is a lookup, it matches ID in both tables.. You dont know what ID's you need to set to "No"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:48:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380704#M701754</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380705#M701755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also if you want to use Kourosh's approach use: -&lt;/P&gt;&lt;P&gt;Put this before your load statement&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;Let v_map = 'ApplyMap('Map_DATASOURCE', THEVALUE)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;Use this in your load statement&lt;/P&gt;&lt;P style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;if( '$(v_map)' = 'SuperUser', 'No' , '$(v_map)' ) as ENDUSEREDIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380705#M701755</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380706#M701756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felim,&lt;/P&gt;&lt;P&gt;I have the ID fields you are correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say 1033459... n, could be any number of them. The value I am passing through the map is this ID. So i cannot do the if on that. This just does not make sense to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say I parr ID 9, then ID 10 through the map. And this returns 'Jimmy', 'Thomas'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then do the if on the returned data, not the ID. So if 'Jimmy = SuperUser','Yes'.... I cannot do this without the map as I only have the ID fields available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this makes sense,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 10:54:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380706#M701756</guid>
      <dc:creator />
      <dc:date>2012-08-24T10:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380707#M701757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically we are checking to see if Jimmy is a Superuser..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to do more than one map to get the result you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First you will need to ApplyMap('MAP',ID,'Unknown') AS User&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next you will need to use this to return the users access, at this point it is becoming more complex.&amp;nbsp; I would suggest left joining your data onto the main table and working from there with a seperate if statement field.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would be the easiest solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 11:10:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380707#M701757</guid>
      <dc:creator />
      <dc:date>2012-08-24T11:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380708#M701758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felim,&lt;/P&gt;&lt;P&gt;Lets simplify, the map does everything that is required. It gets the value I need to compare in the if statement. This is not the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that should the if statement fail, I want to show the original value passed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets look deeper:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if((ApplyMap('Map_DATASOURCE', MYID)) = 'SuperUser','No',Yes') as ENDUSEREDIT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will make a field in the table called ENDUSEREDIT that for each row that says 'No' or 'Yes' depending if the value returned from the map = 'SuperUser'. Very simple and works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I do not want the 'Yes' part. I want the value returned from the map if the fail clause of the IF is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example, this:&lt;/P&gt;&lt;P&gt;if((ApplyMap('Map_DATASOURCE', MYID)) = 'SuperUser','No','USE VALUE RETURNED FROM MAP') as ENDUSEREDIT,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say the map returns 'Jimmy', the If should make ENDUSEREDIT = 'Jimmy'.&lt;/P&gt;&lt;P&gt;Lets say the map returns 'SuperUser', the If should make ENDUSEREDIT = 'No'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if this is helpful as I think we have a misunderstanding on what the problem is. Your help has been great so far though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 11:22:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380708#M701758</guid>
      <dc:creator />
      <dc:date>2012-08-24T11:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Map Load If Function</title>
      <link>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380709#M701759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;right, then parsing the applymap twice is the easiest way and tbh ApplyMap isnt too inefficient.&amp;nbsp; Alot of confusion hehe, its a friday!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 11:59:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Map-Load-If-Function/m-p/380709#M701759</guid>
      <dc:creator />
      <dc:date>2012-08-24T11:59:56Z</dc:date>
    </item>
  </channel>
</rss>

