<?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: How to get total difference in straight table against two values in a dimension? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242642#M394470</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached qvw is a sample data where I am playing with the expression calculation.&amp;nbsp; It doesn't seem to show the difference column.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/147858_Untitled.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2016 00:43:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-12-29T00:43:36Z</dc:date>
    <item>
      <title>How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242636#M394464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have a bunch of metrics (left in image below) that I create as expressions and one date dimension (current and previous week) which limits only two dates. How do I get a total/difference column at the end to calculate the difference between the two weeks which is based on a dimension. C&lt;SPAN style="font-size: 13.3333px;"&gt;olumn WW is what I want.&lt;/SPAN&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/147764_Untitled.png" style="height: 194px; width: 620px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2016 00:36:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242636#M394464</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-28T00:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242637#M394465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try using the column numbers: Column(3) - Column(2)&lt;/P&gt;&lt;P&gt;Or the expression labels: [Week 8] - [Week 7]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2016 10:08:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242637#M394465</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-12-28T10:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242638#M394466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since Week 7 and Week 8 is two values in a dimension, I can't add another column after it to do the calculation. The column on the left where you see "SL1/Top25", "All" and "Inflow" are actual column expression in the straight table.&amp;nbsp; Week is a dimension that has value Week 7 and Week 8.&amp;nbsp; I just transposed the column to row.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2016 19:26:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242638#M394466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-28T19:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242639#M394467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems like you're trying to be like Excel and have a different expression for every single cell. That's technically possible, but not something QlikView is good at. In this case, you might add 'W/W' as a dimension value as well, and then pick the correct calculation based on the dimension value, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(Dimension='Goal',goal calculation&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,if(left(Dimension,4)='Week',weekly calculation&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,if(Dimension='W/W',expression with set analysis to subtract one week from another&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,...)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2016 19:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242639#M394467</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-12-28T19:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242640#M394468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good idea.&amp;nbsp; Let me try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2016 19:49:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242640#M394468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-28T19:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242641#M394469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this if logic but the difference column is not coming up. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;if(Week_Cal_Flag='Previous Week - 1',sum({&amp;lt;Week_Cal_Flag={'Previous Week - 1'}&amp;gt;}CSAT),&lt;/P&gt;&lt;P&gt;if(Week_Cal_Flag='Previous Week',sum({&amp;lt;Week_Cal_Flag={'Previous Week'}&amp;gt;}CSAT),&lt;/P&gt;&lt;P&gt;if(wildmatch(Week_Cal_Flag,'Previous*')&amp;gt;0,sum({&amp;lt;Week_Cal_Flag={'Previous Week'}&amp;gt;}CSAT) - sum({&amp;lt;Week_Cal_Flag={'Previous Week - 1'}&amp;gt;}CSAT)&lt;/P&gt;&lt;P&gt;)))&lt;IMG __jive_id="147879" alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/147879_Untitled.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Dec 2016 23:45:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242641#M394469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-28T23:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242642#M394470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached qvw is a sample data where I am playing with the expression calculation.&amp;nbsp; It doesn't seem to show the difference column.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/147858_Untitled.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 00:43:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242642#M394470</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-29T00:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242643#M394471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your dimension is, say, just [Week Beg Date], and you have 12/11/2016 and 12/18/2016 selected, then that's it, you have two columns. To add another column, you need another value. And you probably don't want to corrupt the [Week Beg Date] field, so you'd want some new dimension linked to it, perhaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wait, we can do better. Something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NewField, Week Beg Date, Sign&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;12/11/2016, 12/11/2016, +1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;12/18/2016, 12/18/2016, +1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;W/W, 12/11/2016, -1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;W/W, 12/18/2016, +1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then a much simpler expression will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension&amp;nbsp; = NewField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression = sum(CSAT * Sign)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the exact table you need and exact values you need are going to depend a lot on your data model and how your user is going to be selecting values, or how else you're determining which two weeks to show. The idea, though, is to handle the complexity with data to the extent possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 00:44:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242643#M394471</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-12-29T00:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242644#M394472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I can get this working. I'll be back shortly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 00:48:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242644#M394472</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-12-29T00:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242645#M394473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, here's an example of what I'm talking about. I changed all the script to match up to my suggested new table and expression, but I think it's essentially the same data model, just with that extra bit controlling the chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 01:04:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242645#M394473</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-12-29T01:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242646#M394474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your example and it works on simple sum.&amp;nbsp; However, I have percentage calculation and I want to do the difference between the two week percentage.&amp;nbsp; It doesn't work when I use the sum and sign from your example &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2017 08:41:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242646#M394474</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-08T08:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242647#M394475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, back to the previous idea. I've added a Weeks Back field, and used this expression. This might not be exactly what you want, but the idea is to check the column to decide which calculation to perform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(Column='W/W',num(sum({&amp;lt;[Weeks Back]={1}&amp;gt;} CSAT)/sum({&amp;lt;[Weeks Back]={2}&amp;gt;} CSAT)-1,'+#,##0%'),num(sum(CSAT),'#,##0'))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 17:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242647#M394475</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2017-01-09T17:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242648#M394476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You are getting close.&amp;nbsp; However, I want the % calculate for each week and the do the different on the two weeks. See image and Qlikview file where I added another dimension to the raw data.&lt;IMG __jive_id="148873" alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148873_Untitled.png" style="height: 237px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 01:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242648#M394476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-10T01:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get total difference in straight table against two values in a dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242649#M394477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: courier new,courier;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;SPAN style="color: #800000;"&gt;Column&lt;/SPAN&gt;='W/W'&lt;BR /&gt; ,&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #800000;"&gt;SL&lt;/SPAN&gt;={'SL1'},&lt;SPAN style="color: #800000;"&gt;[Weeks Back]&lt;/SPAN&gt;={1}&amp;gt;} &lt;SPAN style="color: #800000;"&gt;CSAT&lt;/SPAN&gt;)/&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #800000;"&gt;[Weeks Back]&lt;/SPAN&gt;={1}&amp;gt;} &lt;SPAN style="color: #800000;"&gt;CSAT&lt;/SPAN&gt;)&lt;BR /&gt; -&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #800000;"&gt;SL&lt;/SPAN&gt;={'SL1'},&lt;SPAN style="color: #800000;"&gt;[Weeks Back]&lt;/SPAN&gt;={2}&amp;gt;} &lt;SPAN style="color: #800000;"&gt;CSAT&lt;/SPAN&gt;)/&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #800000;"&gt;[Weeks Back]&lt;/SPAN&gt;={2}&amp;gt;} &lt;SPAN style="color: #800000;"&gt;CSAT&lt;/SPAN&gt;)&lt;BR /&gt; ,&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #800000;"&gt;SL&lt;/SPAN&gt;={'SL1'}&amp;gt;} &lt;SPAN style="color: #800000;"&gt;CSAT&lt;/SPAN&gt;)/&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;CSAT&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;))&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/149016_Capture.PNG" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 19:06:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-total-difference-in-straight-table-against-two-values/m-p/1242649#M394477</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2017-01-10T19:06:33Z</dc:date>
    </item>
  </channel>
</rss>

