<?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 Comparing two data sources into a PivotTable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Comparing-two-data-sources-into-a-PivotTable/m-p/1717971#M54532</link>
    <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;I've gotten pretty far with developing a dashboard of mine, but I seem to be stuck at something:&lt;/P&gt;&lt;P&gt;From data side I am loading two tables in which I'm importing &lt;U&gt;current&lt;/U&gt; and &lt;U&gt;last week data&lt;/U&gt;.&lt;BR /&gt;I built a pivot table to compare some figures from the two datasets above.&lt;BR /&gt;Problem is with the comparison itself, I can't seem to "marry" the two together. I can't "lookup" the same category in the historical table dynamically, only if I specifically specify it with a if condition. Categories are the same between the two tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnMcDoe_0-1591886103547.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/35372i1EE09D56E19E121B/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohnMcDoe_0-1591886103547.png" alt="JohnMcDoe_0-1591886103547.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation formula I am using:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas"&gt;Sum({&amp;lt;LastFriday.CurrentStage = {'Assigned','Created'}&amp;gt;} &lt;FONT color="#333399"&gt;if(LastFriday.MainCategory = MainCategory , [SalesValue1LastFriday])&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Highlighted is the part that probably needs changing)&lt;/P&gt;&lt;P&gt;So in short, I need to match LastFriday.MainCategory (the MainCategory field from the LastFriday table) to the same field in the Pivot Table, which uses the non-historic MainCategory values). I tried to account for this with a simple &lt;EM&gt;&lt;STRONG&gt;if&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;as seen above, but the data it spits is not accurate. If I manually specify the category:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas"&gt;Sum({&amp;lt;LastFriday.CurrentStage = {'Assigned','Created'}&amp;gt;} &lt;FONT color="#333399"&gt;if(LastFriday.MainCategory = &lt;STRONG&gt;'B'&lt;/STRONG&gt; , [SalesValue1LastFriday])&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then it works flawlessly, it's just then applies it to every row, obviously.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jun 2020 14:42:52 GMT</pubDate>
    <dc:creator>JohnMcDoe</dc:creator>
    <dc:date>2020-06-11T14:42:52Z</dc:date>
    <item>
      <title>Comparing two data sources into a PivotTable</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-two-data-sources-into-a-PivotTable/m-p/1717971#M54532</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;I've gotten pretty far with developing a dashboard of mine, but I seem to be stuck at something:&lt;/P&gt;&lt;P&gt;From data side I am loading two tables in which I'm importing &lt;U&gt;current&lt;/U&gt; and &lt;U&gt;last week data&lt;/U&gt;.&lt;BR /&gt;I built a pivot table to compare some figures from the two datasets above.&lt;BR /&gt;Problem is with the comparison itself, I can't seem to "marry" the two together. I can't "lookup" the same category in the historical table dynamically, only if I specifically specify it with a if condition. Categories are the same between the two tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnMcDoe_0-1591886103547.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/35372i1EE09D56E19E121B/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohnMcDoe_0-1591886103547.png" alt="JohnMcDoe_0-1591886103547.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation formula I am using:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas"&gt;Sum({&amp;lt;LastFriday.CurrentStage = {'Assigned','Created'}&amp;gt;} &lt;FONT color="#333399"&gt;if(LastFriday.MainCategory = MainCategory , [SalesValue1LastFriday])&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Highlighted is the part that probably needs changing)&lt;/P&gt;&lt;P&gt;So in short, I need to match LastFriday.MainCategory (the MainCategory field from the LastFriday table) to the same field in the Pivot Table, which uses the non-historic MainCategory values). I tried to account for this with a simple &lt;EM&gt;&lt;STRONG&gt;if&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;as seen above, but the data it spits is not accurate. If I manually specify the category:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas"&gt;Sum({&amp;lt;LastFriday.CurrentStage = {'Assigned','Created'}&amp;gt;} &lt;FONT color="#333399"&gt;if(LastFriday.MainCategory = &lt;STRONG&gt;'B'&lt;/STRONG&gt; , [SalesValue1LastFriday])&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then it works flawlessly, it's just then applies it to every row, obviously.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 14:42:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-two-data-sources-into-a-PivotTable/m-p/1717971#M54532</guid>
      <dc:creator>JohnMcDoe</dc:creator>
      <dc:date>2020-06-11T14:42:52Z</dc:date>
    </item>
  </channel>
</rss>

