<?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: Set Analysis expression equivalent to If expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328815#M121027</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ishraque,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me I think that you don't need to do a set analysis. Because in this case you have used disconnect table and it can be slow on printing data (test it with 10,000 record will see the problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have one solution for you. Let try it&lt;/P&gt;&lt;P&gt;- Use only one table [InvoiceHeader]&lt;/P&gt;&lt;P&gt;- Create one Pivot Table with [InvMonthYear] as Dimensions and SUM([InvoiceAmount]) as Expressions.&lt;/P&gt;&lt;P&gt;- If you need to create template like your object (horizontal in MonthYear), you need to drag column [InvMonthYear] from vertical to horizontal.&lt;/P&gt;&lt;P&gt;- If you need to sort InvMonthYear then try do it in Sort tab with expression:&lt;/P&gt;&lt;P&gt;Match(LEFT(InvMonthYear,3), $(=chr(39) &amp;amp; Replace(MonthNames, ';', chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39))) + (RIGHT(InvMonthYear,4)*100)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the sample attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2011 10:30:54 GMT</pubDate>
    <dc:creator>Sokkorn</dc:creator>
    <dc:date>2011-10-13T10:30:54Z</dc:date>
    <item>
      <title>Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328808#M121020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends,&lt;/P&gt;&lt;P&gt;I have written an expression using If in the below manner - &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ﻿﻿Sum(IF(PrevMY=InvMonthYear, InvoiceAmount, 0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: in the above expression PrevMY, InvMonthYear and InvoiceAmount are the fields in QVD files. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Can anyone help me to write Set Analysis equivalent expression of the above one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks in advance.&lt;/P&gt;&lt;P&gt;Ishraque Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 05:58:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328808#M121020</guid>
      <dc:creator />
      <dc:date>2011-10-12T05:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328809#M121021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ishraque,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let try this SUM({$&amp;lt;PrevMY = {$(InvMonthYear)}&amp;gt;} InvoiceAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this one working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 06:11:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328809#M121021</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-12T06:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328810#M121022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sokkorn,&lt;/P&gt;&lt;P&gt;Thanks for your reply. Applying this expression gives different result than the Original one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of your suggested expression is equivalent to the result of Sum(InvoiceAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ishraque Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 06:29:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328810#M121022</guid>
      <dc:creator />
      <dc:date>2011-10-12T06:29:23Z</dc:date>
    </item>
    <item>
      <title>Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328811#M121023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; try the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;PrevMY = {"$(InvMonthYear)"}&amp;gt;} InvoiceAmount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 06:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328811#M121023</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2011-10-12T06:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328812#M121024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please see the attached file,i hope this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 06:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328812#M121024</guid>
      <dc:creator />
      <dc:date>2011-10-12T06:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328813#M121025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ishraque,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to load data like this&lt;/P&gt;&lt;P&gt;[tmp1]:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;IF(PrevMY=InvMonthYear,1,0)&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Flag;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;No,PrevMY,InvMonthYear,InvoiceAmount&lt;/P&gt;&lt;P&gt;1,2009,2009,30&lt;/P&gt;&lt;P&gt;2,2009,2010,40&lt;/P&gt;&lt;P&gt;3,2010,2010,50&lt;/P&gt;&lt;P&gt;4,2010,2011,60];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use set analysis SUM({$&amp;lt;Flag = {1}&amp;gt;} InvoiceAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 07:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328813#M121025</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-12T07:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328814#M121026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not yet able to solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have extracted the faulty piece of code in Sample.qvw file and uploading it for your reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the prectical problem and guide me if possible to apply the correct syntax of Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ishraque Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 10:01:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328814#M121026</guid>
      <dc:creator />
      <dc:date>2011-10-13T10:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328815#M121027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ishraque,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me I think that you don't need to do a set analysis. Because in this case you have used disconnect table and it can be slow on printing data (test it with 10,000 record will see the problem).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have one solution for you. Let try it&lt;/P&gt;&lt;P&gt;- Use only one table [InvoiceHeader]&lt;/P&gt;&lt;P&gt;- Create one Pivot Table with [InvMonthYear] as Dimensions and SUM([InvoiceAmount]) as Expressions.&lt;/P&gt;&lt;P&gt;- If you need to create template like your object (horizontal in MonthYear), you need to drag column [InvMonthYear] from vertical to horizontal.&lt;/P&gt;&lt;P&gt;- If you need to sort InvMonthYear then try do it in Sort tab with expression:&lt;/P&gt;&lt;P&gt;Match(LEFT(InvMonthYear,3), $(=chr(39) &amp;amp; Replace(MonthNames, ';', chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39))) + (RIGHT(InvMonthYear,4)*100)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the sample attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 10:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328815#M121027</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-13T10:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis expression equivalent to If expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328816#M121028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your reply that has helped me improving my knowledge. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sample I have attached in my previous reply is not my exact requirement (as I have mentioned it is extracted columns, records and KPI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are few points in my application which will give you some idea to understand my requirement as - &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Invoice Table has around 1,200,000 records with many other fields (I have extracted few fields with limited records).&lt;/LI&gt;&lt;LI&gt;Invoice Summary (UI) does not contain only the fields I am showing in the Sample. It has some other fields also displayed and then the 12 months Invoice Summary.&lt;/LI&gt;&lt;LI&gt;﻿﻿Invoice Summary (UI) in application is a Drilldown table having Order Type, Part Type, Shipping Mode, Trade Term, Freight Forwarder and Customer as drilldown attributes.&lt;/LI&gt;&lt;LI&gt;Above all these there are many other places where I would apply aggregate functions based on two fields matching criteria.&lt;/LI&gt;&lt;LI&gt;﻿RequiredMY Calendar that I am loading would be dynamic and populated based on the Year selected from the UI. I have taken System Date - 2 Years in Sample to simplify it.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Main Issue is why SET is not comparing 1 field value with another field value whereas IF behaves as expected? I feel my syntax is wrong and hence want to arrive at the correct syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ishraque Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 11:23:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-expression-equivalent-to-If-expression/m-p/328816#M121028</guid>
      <dc:creator />
      <dc:date>2011-10-13T11:23:57Z</dc:date>
    </item>
  </channel>
</rss>

