<?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: Compare meanings and apply mapping in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614793#M735599</link>
    <description>&lt;P&gt;Time is a TimeStamp. It contains data, hours, minutes and seconds.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2019 12:33:20 GMT</pubDate>
    <dc:creator>Olya</dc:creator>
    <dc:date>2019-08-21T12:33:20Z</dc:date>
    <item>
      <title>Compare meanings and apply mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614743#M735596</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to compare the changed meanings in the table which I load and apply the mapping. Which function is better to use? Currently,&amp;nbsp; my code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ActivityType: //Create Map with Events&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Mapping Load * Inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ID, Event&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;0, Start&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1, Change Status&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2, Change Progress&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3, Change Probability&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4, Change Value&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;5, Change Status and Progress&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Data: // Load Data&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CaseID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;Status,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Progress,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Prob,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;"Time",&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;Value&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM [… data.qvd]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(qvd);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// Make Ids&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ActivityTypeID:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(CaseID = Previous(CaseID) AND Status &amp;lt;&amp;gt; Previous(Status),1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(CaseID = Previous(CaseID) AND Progress &amp;lt;&amp;gt; Previous(Progress), 2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(CaseID = Previous(CaseID) AND Prob &amp;lt;&amp;gt; Previous(Prob), 3,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(CaseID = Previous(CaseID) AND Value &amp;lt;&amp;gt; Previous(Value), 4,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(CaseID = Previous(CaseID) AND Status &amp;lt;&amp;gt; Previous(Status) AND Progress&amp;lt;&amp;gt; Previous(Progress), 5,&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0)))))) as ActivityTypeID // add More&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Data ORDER BY CaseID desc, "Time" asc;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate&lt;BR /&gt;// Create Table with Events&lt;BR /&gt;Final:&lt;BR /&gt;Load *, ApplyMap('ActivityType', ActivityTypeID, 'No ActivityTypeID') as ActivityType &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;R&lt;/EM&gt;&lt;EM&gt;esident ActivityTypeID; // Apply the Map&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I realized that IF checks just the first condition and does not go further. On running the script I do not have values&amp;nbsp; with&amp;nbsp;&lt;EM&gt;5, Change Status and&amp;nbsp;&lt;/EM&gt;&lt;I&gt;Progress &lt;/I&gt;in the new data set .&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614743#M735596</guid>
      <dc:creator>Olya</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Compare meanings and apply mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614767#M735597</link>
      <description>&lt;P&gt;The syntax looks ok. and also the mapping should work - whereby I would do the mapping within a preceeding load instead of using an extra resident load. This means:&lt;/P&gt;&lt;P&gt;...&lt;BR /&gt;&lt;EM&gt;ActivityTypeID:&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Load *, ApplyMap('ActivityType', ActivityTypeID, 'No ActivityTypeID') as ActivityType ;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Load *,&amp;nbsp;&lt;/EM&gt;&lt;EM&gt; IF(CaseID = Previous(CaseID) AND Status &amp;lt;&amp;gt; Previous(Status),1,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ...&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Resident Data ORDER BY CaseID desc, "Time" asc;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you don't get the expected values it will be probably caused from the sorting (is Time really a numeric value?) and/or the order and construction of your if-loops - you may need to reverse them and/or checking more than two fields within a single if-loop.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 11:44:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614767#M735597</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-08-21T11:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compare meanings and apply mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614776#M735598</link>
      <description>&lt;P&gt;Thank you, Marcus.&lt;/P&gt;&lt;P&gt;What if I would like to add more variants in the mapping table?&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;P&gt;7, Change Status and Progress&lt;BR /&gt;8, Change Status and Probability&lt;BR /&gt;9, Change Status and Value&lt;BR /&gt;&lt;BR /&gt;13, Change Progress and Probability&lt;BR /&gt;14, Change Progress and Value&lt;BR /&gt;15, Change Probability and Value&lt;/P&gt;&lt;P&gt;21, Change Progress and Probability and Value&lt;/P&gt;&lt;P&gt;22, Change Status and Progress and Probability&lt;BR /&gt;23, Change Status and Progress and Value&lt;BR /&gt;24, Change Status and Probability and Value&lt;BR /&gt;25, Change Progress and Probability and Value&lt;/P&gt;&lt;P&gt;26, Change Status&amp;nbsp; and Progress and Probability and Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it OK to still use IF function? May I use switch...case instead?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 12:05:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614776#M735598</guid>
      <dc:creator>Olya</dc:creator>
      <dc:date>2019-08-21T12:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compare meanings and apply mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614793#M735599</link>
      <description>&lt;P&gt;Time is a TimeStamp. It contains data, hours, minutes and seconds.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 12:33:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614793#M735599</guid>
      <dc:creator>Olya</dc:creator>
      <dc:date>2019-08-21T12:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare meanings and apply mapping</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614797#M735600</link>
      <description>&lt;P&gt;In this way the conditions would be overlapping. If you apply them in the right order (the one with the most conditions needs to be queried first) it may work whereby with just one field you will lose some kind of granularity because a record of:&lt;/P&gt;&lt;P&gt;Change Status and Progress and Probability and Value&lt;/P&gt;&lt;P&gt;won't be anymore&lt;/P&gt;&lt;P&gt;Change Status and Progress&lt;/P&gt;&lt;P&gt;If this is fine you could use it so - if not you may need multiple fields for it. This means some kind of grouping like in a dimension-table (which might then more suitable as the mapping) of main-group, sub-group, atomic.&lt;/P&gt;&lt;P&gt;Alternatively it should be possible to merge them into a single field by using an as-of-table approach for it but it will be a significantely increase of the complexity.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 12:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-meanings-and-apply-mapping/m-p/1614797#M735600</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-08-21T12:35:10Z</dc:date>
    </item>
  </channel>
</rss>

