<?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: Need help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375214#M139756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Each line needs to be read&lt;/LI&gt;&lt;LI&gt;if date from today is greater then 12 months, aggregate Sales Amount only for those line.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2012 19:51:47 GMT</pubDate>
    <dc:creator>userid128223</dc:creator>
    <dc:date>2012-06-29T19:51:47Z</dc:date>
    <item>
      <title>Aggr with If condition.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375211#M139753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let say I have a table like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesDate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SaleAmount&lt;/P&gt;&lt;P&gt;10/02/2010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 55&lt;/P&gt;&lt;P&gt;11/03/2009&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 44&lt;/P&gt;&lt;P&gt;&amp;nbsp; 5/05/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; 2/04/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1/07/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&amp;nbsp; 5/11/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2/02/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; 1/01/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3/04/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) How can I show total SalesAmount if SalesDate is less then 12 months old from todays date. In this case expression will read each record and add total sales if the date is not older then 12 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to show this is a text box. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below expression does not work because it cannot read each salesdate individually and total it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(SalesDate &amp;gt; AddMonths(today(),-12),sum(SalesAmount),0) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 19:16:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375211#M139753</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-06-29T19:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375212#M139754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to convert your date into number using the num function, like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;num(SalesDate) as SalesDate_Num&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;SalesDate,&lt;/P&gt;&lt;P&gt;SaleAmount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;SalesDate ,&amp;nbsp;&amp;nbsp; SaleAmount&lt;/P&gt;&lt;P&gt;10/02/2010 ,&amp;nbsp;&amp;nbsp;&amp;nbsp; 55&lt;/P&gt;&lt;P&gt;11/03/2009,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 44&lt;/P&gt;&lt;P&gt;&amp;nbsp; 5/05/2011 ,&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; 2/04/2011,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1/07/2011 ,&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&amp;nbsp; 5/11/2012 ,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2/02/2012 ,&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; 1/01/2012 ,&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3/04/2012&amp;nbsp; ,&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;&amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy paste this to a dummy qvw and try. Then you subtract the dates easily.&lt;/P&gt;&lt;P&gt;Then you can write a condition say, if(SalesDate- num(Today())&amp;gt;365, 'Do this', 'Do that');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Bikash Debnath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 19:35:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375212#M139754</guid>
      <dc:creator />
      <dc:date>2012-06-29T19:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375213#M139755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That suggetion will not work. Its huge table trying to convert that into Inline will be nighmare. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The date function is not an issue. It is how to read each line of transaction data, and aggr (sum the SaleAmount where)&amp;nbsp; only if the condition of 12 months or less is true.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 19:45:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375213#M139755</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-06-29T19:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375214#M139756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Each line needs to be read&lt;/LI&gt;&lt;LI&gt;if date from today is greater then 12 months, aggregate Sales Amount only for those line.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 19:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375214#M139756</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-06-29T19:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375215#M139757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ooooppss my bad....please excuse me, I wasn't clear enough while explaining.&lt;/P&gt;&lt;P&gt;I didn't mean to do an inline load on your data. I used your sample data set and loaded into my qvw using an inline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you shall have to do it in two steps,&lt;/P&gt;&lt;P&gt;first create a flag( a new field) if(num(SalesDate)-num(Today())&amp;lt;365,'Y', 'N') as Flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load this table using the Resident load and&lt;/P&gt;&lt;P&gt;sum the total if the flag is 'Y' and zero for 'N'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop the first table later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bikash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 19:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375215#M139757</guid>
      <dc:creator />
      <dc:date>2012-06-29T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr with If condition.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375216#M139758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Today(),-12)'}&amp;gt;}SaleAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the quotes, may be I missed any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 20:57:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375216#M139758</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-06-29T20:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375217#M139759</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 21:12:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375217#M139759</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-06-29T21:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375218#M139760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this aggregates each row of SaleAmount based on date. I think&amp;nbsp; your statement just checks max date and if it is less then 12 months it does total sum. Which is not what I require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The answer in my case should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;10/02/2010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 55&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FALSE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;11/03/2009&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 44&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FALSE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 5/05/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FALSE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 2/04/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FALSE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 1/07/2011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRUE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 5/11/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRUE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 2/02/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRUE&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 1/01/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRUE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;&amp;nbsp; 3/04/2012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I want the answer for total of all All True. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 21:52:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375218#M139760</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-06-29T21:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375219#M139761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yeah then you should write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(flag='TRUE', sum(SaleAmount),0) in your expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 21:54:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375219#M139761</guid>
      <dc:creator />
      <dc:date>2012-06-29T21:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375220#M139762</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Check the below file. Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 22:08:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375220#M139762</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-06-29T22:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375221#M139763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 22:20:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375221#M139763</guid>
      <dc:creator />
      <dc:date>2012-06-29T22:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375222#M139764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can someone please explain this set analysis step by step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;=sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount)&lt;/SPAN&gt;&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;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2012 01:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375222#M139764</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-06-30T01:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375223#M139765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me try explain your set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;execution starts from the innermost expression - 'Max(SalesDate)' - it picks the maximum date from SalesDate.&lt;/LI&gt;&lt;LI&gt;Now 'AddMonths(.....maximum date got from earlier expression),-12' - takes it to 12 months back, i.e. the previous year similar date(if the max date was 1-2-12, now it generates 1-2-11).&lt;/LI&gt;&lt;LI&gt;now the expression checks for '&amp;lt;SalesDate={'&amp;gt;=.....&amp;gt;' part - which gets the dates from SalesDate which are less than or equal to date generated at the second step (the previous year maximim date).&lt;/LI&gt;&lt;LI&gt;now 'Sum(....SalesAmonut)' part of expression finally gives you the summation of the SalesAmount for those transaction dates which are generated in third step (dates before or equal to last year maximum date).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;tresesco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2012 04:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375223#M139765</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2012-06-30T04:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375224#M139766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven´t tried this, so could be wrong but I would try it.&lt;/P&gt;&lt;P&gt;Hope this helps. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(aggr(&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Today(),-12)'}&amp;gt;}SalesAmount)&lt;/SPAN&gt;, SalesDate) &amp;gt; X, 'do this', 'do else')&lt;/P&gt;&lt;P&gt;I´m assuming that you are using SalesDate as dimension in your chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you coul try to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate dimension:&lt;/P&gt;&lt;P&gt;If(SalesDate&amp;gt;= addmonths(today(),-12), SalesDate) //this returns only the dates since the prior year from today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;aggr(sum(SalesAmount),SalesDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck, let me know your results.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2012 12:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375224#M139766</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-07-02T12:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375225#M139767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the answers, I will try it out today and let you guys know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been able to do simple set analysis and understand them. However this is bit complicated. What is the best place to learn set analysis, syntax. Do you need programming background in order to grasp the concept?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 13:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375225#M139767</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-07-03T13:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375226#M139768</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this below link, hope it will help you to know basic set analysis concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa=_CNGH  "&gt; http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa=_CNGH&amp;nbsp; &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 13:45:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375226#M139768</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-07-03T13:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375227#M139769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mayil Thanks for the wizard. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now please tell me how you will come up with below solution using this wizard step by step. Is it possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;=sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375227#M139769</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-07-03T15:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375228#M139770</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;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.Sum(SaleAmount) gives sum of all the sales amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. Max(SalesDate) give the maximum date which you select in your field for example , if you select 5/5/2011,6/5/2011,7/7/2011 in this selection, it gives 7/7/2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3. AddMonths(startDate,n)&amp;nbsp; function&lt;/P&gt;&lt;P&gt;Returns the date occurring &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; months after &lt;SPAN class="Italic"&gt;startdate&lt;/SPAN&gt; or, if &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; is negative, the date occurring &lt;SPAN class="Italic"&gt;n&lt;/SPAN&gt; months before &lt;SPAN class="Italic"&gt;startdate&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;addmonths ('2003-01-29',3)&lt;/SPAN&gt; returns '2003-04-29'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. So &lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;&lt;STRONG&gt;=sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount) &lt;/STRONG&gt;in this , for example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;sum({&amp;lt;SalesDate = {'&amp;gt;=AddMonths(Max(7/7/2011), -12)'}&amp;gt; SaleAmount )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;AddMonths(Max(7/7/2011), -12) gives the date 7/7/2010 &lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;,i.e. previous year of same date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;&amp;gt;= means, greater than or equal to&amp;nbsp; 7/7/2010&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;so from 7/7/2010 to 7/7/2011 sales amount calculate and give result.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;Hope it helps&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375228#M139770</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-07-03T15:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375229#M139771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mayil for the answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got the explaination part. Now for the syntax any clues, any tips how to organize and remember.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i had 2 statement like this on two seperate text box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sales Amount store 1&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;=sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sales Amount Store 2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;=sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can subtract 1 from the 2 in seperate text box. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375229#M139771</guid>
      <dc:creator>userid128223</dc:creator>
      <dc:date>2012-07-03T15:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375230#M139772</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;By practice you can remember easily..See the link which i mentioned in earlier post.That also help you for know more about set anlysis..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;=Sum(&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;{&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount) - sum({&amp;lt;SalesDate={'&amp;gt;=$(=AddMonths(Max(SalesDate),-12))'}&amp;gt;}SaleAmount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;Itself you give in text box ..But the result is szero only i think. because both are same expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;If you use in straight table or pivot table in expression part, you can use column(2) - column(1). Which post give helps to u, can u mark as helpful answer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: Arial; color: #636363; font-size: 12px;"&gt;Hope it helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:49:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-condition/m-p/375230#M139772</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-07-03T15:49:16Z</dc:date>
    </item>
  </channel>
</rss>

