<?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: Formula in Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516944#M750247</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Maybe not the best approach but,&lt;/P&gt;&lt;P&gt;IF( SUM(&lt;SPAN&gt;Field1 - Field2&lt;/SPAN&gt;) = 0, SUM(Amount))&lt;/P&gt;&lt;P&gt;should do the trick.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 16:42:02 GMT</pubDate>
    <dc:creator>Mark_Little</dc:creator>
    <dc:date>2018-12-05T16:42:02Z</dc:date>
    <item>
      <title>Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516930#M750245</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I need to create an expression in a chart and filter the values by using a set analysis.&amp;nbsp;Here is the idea:&lt;/P&gt;&lt;P&gt;KPI = Sum({&amp;lt;(Field 1 - Field 2)-={0}&amp;gt;} Amount)&amp;nbsp;&lt;/P&gt;&lt;P&gt;(exclude the&amp;nbsp;values where the result of the formula is =0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if this is possible and what would be the syntax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516930#M750245</guid>
      <dc:creator>edemerdjieva</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516937#M750246</link>
      <description>&lt;P&gt;Against which dimension are you checking Field1 - Field is not equal to 0? Lets Call it &lt;FONT color="#FF0000"&gt;DimX&lt;/FONT&gt;... try this&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;&lt;FONT color="#FF0000"&gt;DimX&lt;/FONT&gt; = {"=(Field1 - Field2) &amp;lt;&amp;gt; 0"}&amp;gt;} Amount) &lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 16:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516937#M750246</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-05T16:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516944#M750247</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Maybe not the best approach but,&lt;/P&gt;&lt;P&gt;IF( SUM(&lt;SPAN&gt;Field1 - Field2&lt;/SPAN&gt;) = 0, SUM(Amount))&lt;/P&gt;&lt;P&gt;should do the trick.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 16:42:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516944#M750247</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2018-12-05T16:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516946#M750248</link>
      <description>&lt;P&gt;Actually, it's not a dimension that I'm checking but the result of two facts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the data model we have:&lt;/P&gt;&lt;P&gt;Dimension: Voucher&lt;/P&gt;&lt;P&gt;Fact 1: Voucher Amount (issue value)&lt;/P&gt;&lt;P&gt;Fact 2 (several possible): Voucher Amount Used (a voucher car be used&amp;nbsp;partially, so many&amp;nbsp;usages)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The chart should not include vouchers without remaining&amp;nbsp; value (=0). So that's why i try to filter the liste through set analysis:&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here is an example with data: the last line&amp;nbsp; should not appear in the chart.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 723px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1657i917818EFC30075BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 16:47:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516946#M750248</guid>
      <dc:creator>edemerdjieva</dc:creator>
      <dc:date>2018-12-05T16:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516949#M750249</link>
      <description>&lt;P&gt;Does a Voucher code can only have one and only one voucher date issue? If it does, then you can try this&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;[Voucher Code] = {"=Sum([Voucher Issue Amount]) - Sum([Voucher Used Amount]) &amp;lt;&amp;gt; 0"}&amp;gt;} [Voucher Issue Amount])

Sum({&amp;lt;[Voucher Code] = {"=Sum([Voucher Issue Amount]) - Sum([Voucher Used Amount]) &amp;lt;&amp;gt; 0"}&amp;gt;} [Voucher Used Amount])&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 16:53:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516949#M750249</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-05T16:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516952#M750250</link>
      <description>Hi Again,&lt;BR /&gt;The way I would approach this then would be in script and flag the Voucher Codes your interested in.&lt;BR /&gt;&lt;BR /&gt;Something like&lt;BR /&gt;IF([Voucher Issue Amount] = [Voucher Used Amount], 0,1) AS [Voucher Outstanding],&lt;BR /&gt;&lt;BR /&gt;Then in set analysis you could use something like&lt;BR /&gt;SUM({&amp;lt;[Voucher Outstanding]={1}&amp;gt;}[Voucher Issue Amount] = [Voucher Used Amount])&lt;BR /&gt;&lt;BR /&gt;If the the above table is transactional will need a aggregate table to flag the vouchers&lt;BR /&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;[Voucher Code],&lt;BR /&gt;IF(SUM([Voucher Issue Amount]) - SUM([Voucher Used Amount]) = 0, 0,1) AS [Voucher Outstanding]&lt;BR /&gt;Resident Table&lt;BR /&gt;GROUP BY [Voucher Code] ;&lt;BR /&gt;&lt;BR /&gt;Table being your data table.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Mark</description>
      <pubDate>Wed, 05 Dec 2018 16:55:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516952#M750250</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2018-12-05T16:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516964#M750251</link>
      <description>&lt;P&gt;Yes, there is only one date issue.&lt;/P&gt;&lt;P&gt;I tried your suggestion but I have some syntaxe issue because I have also set analysis in the&amp;nbsp; Sum (Voucher Amount)&lt;/P&gt;&lt;PRE&gt;Sum(&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;{&amp;lt;[Date]={"&amp;gt;=$(v_DateIssue_1) &amp;lt;=$(v_DateIssue_2)"}&amp;gt;}&lt;/STRONG&gt;&lt;/FONT&gt;[Voucher Issue Amount])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the complete KPI in this case:&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;[Voucher Code] = {"=Sum({set analysis as above}[Voucher Issue Amount]) - Sum({set analysis as above}[Voucher Used Amount]) &amp;lt;&amp;gt; 0"}, set analysis as above &amp;gt;} [Voucher Issue Amount])&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But there is a syntax issue because of the quotes in the second set analysis.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 17:23:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516964#M750251</guid>
      <dc:creator>edemerdjieva</dc:creator>
      <dc:date>2018-12-05T17:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516965#M750252</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/29012"&gt;@Mark_Little&lt;/a&gt;&lt;/P&gt;&lt;P&gt;This would not work in load script because the chart is based on date selection. And at a given time a voucher can have a remaining value.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 17:15:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1516965#M750252</guid>
      <dc:creator>edemerdjieva</dc:creator>
      <dc:date>2018-12-05T17:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517063#M750253</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;[Voucher Code] = {"=Sum({&amp;lt;[Date] = {[&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)]}&amp;gt;} [Voucher Issue Amount]) - Sum({"=Sum({&amp;lt;[Date] = {[&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)]} [Voucher Used Amount]) &amp;lt;&amp;gt; 0"}, [Date] = {"&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)"}&amp;gt;} [Voucher Issue Amount]) &lt;/PRE&gt;&lt;P&gt;Basically use [] instead of double quotes around the inner set analysis... you can also use escape sequence by using 2 double quotes within the inner set analysis&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;[Voucher Code] = {"=Sum({&amp;lt;[Date] = {""&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)""}&amp;gt;} [Voucher Issue Amount]) - Sum({"=Sum({&amp;lt;[Date] = {""&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)""} [Voucher Used Amount]) &amp;lt;&amp;gt; 0"}, [Date] = {"&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)"}&amp;gt;} [Voucher Issue Amount]) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 01:49:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517063#M750253</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-06T01:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517220#M750254</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;Hi could you please explain a little more of how the transactions look in the data, might be able suggest better?&lt;BR /&gt;&lt;BR /&gt;Mark</description>
      <pubDate>Thu, 06 Dec 2018 09:40:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517220#M750254</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2018-12-06T09:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517282#M750255</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&lt;/P&gt;&lt;P&gt;It worked &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; !&lt;/P&gt;&lt;P&gt;There were two small syntax errors, so here is the final expression :&lt;/P&gt;&lt;PRE&gt;Sum({&amp;lt;[Voucher Code] = {"=Sum({&amp;lt;[Date] = {[&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)]}&amp;gt;} [Voucher Issue Amount]) - Sum({&amp;lt;[Date] = {[&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)]&amp;gt;} [Voucher Used Amount]) &amp;lt;&amp;gt; 0"}, [Date] = {"&amp;gt;=$(v_DateIssue_1)&amp;lt;=$(v_DateIssue_2)"}&amp;gt;} [Voucher Issue Amount]) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for the explanations.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 11:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517282#M750255</guid>
      <dc:creator>edemerdjieva</dc:creator>
      <dc:date>2018-12-06T11:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517343#M750256</link>
      <description>Super!! I am glad we were able to figure it out in the end &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 06 Dec 2018 12:17:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-Set-Analysis/m-p/1517343#M750256</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-06T12:17:52Z</dc:date>
    </item>
  </channel>
</rss>

