<?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: Compartively analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348302#M1175518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do you have date field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;DateField={"&amp;gt;=$(=YearStart(Max(DateField)))&amp;lt;=$(=MonthEnd(Max(DateField),-1))"},Year=,Month=&amp;gt;} LineSalesAmount) //sales of 2011 for jan to aug&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;DateField={"&amp;gt;=$(=MonthStart(Max(DateField)))&amp;lt;=$(=MonthEnd(Max(DateField)))"},Year=,Month=&amp;gt;} LineSalesAmount)// 2011 for sep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 10:15:05 GMT</pubDate>
    <dc:creator>CELAMBARASAN</dc:creator>
    <dc:date>2012-04-12T10:15:05Z</dc:date>
    <item>
      <title>Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348295#M1175511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to compare sales of current year vs last year. for this i have&amp;nbsp; used this expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=only(Year))}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=only(Year)-1)}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it works fine when i select a year field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But suppose when i dont select any year, i want the comparision between current year vs previous&amp;nbsp; all years&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 06:38:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348295#M1175511</guid>
      <dc:creator />
      <dc:date>2012-04-12T06:38:42Z</dc:date>
    </item>
    <item>
      <title>Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348296#M1175512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;The Only gives you Null when you have multiple values.&lt;/P&gt;&lt;P&gt;You could use the Max() function instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, if you dont have any year selected&amp;nbsp; the expression will use the highest year (I.e current year)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=max(Year))}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=max(Year)-1)}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 06:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348296#M1175512</guid>
      <dc:creator />
      <dc:date>2012-04-12T06:51:57Z</dc:date>
    </item>
    <item>
      <title>Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348297#M1175513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suppose i have sales data from year 2005 to 2011. then how to see the sales of 2005 to 2010 vs sales of 2011&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 07:03:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348297#M1175513</guid>
      <dc:creator />
      <dc:date>2012-04-12T07:03:27Z</dc:date>
    </item>
    <item>
      <title>Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348298#M1175514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You just alter the second expression to something like the following...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=max(Year))}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={"&amp;lt;=$(=max(Year)-1)"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first expression is the same.&lt;/P&gt;&lt;P&gt;The second expression says that Years shall be less or equal to Previous year.&lt;/P&gt;&lt;P&gt;Of course the following is the same:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={"&amp;lt;$(=max(Year))"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;Year shall be less to current year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also have a intervall:&lt;/P&gt;&lt;P&gt; sum({$&amp;lt;Year={"&amp;lt;$(=max(Year))&amp;gt;$(=max(Year)-5)"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;Year shall be less than current year and also more than current year-5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 07:45:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348298#M1175514</guid>
      <dc:creator />
      <dc:date>2012-04-12T07:45:20Z</dc:date>
    </item>
    <item>
      <title>Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348299#M1175515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My next query is...&lt;/P&gt;&lt;P&gt;suppose i select year 2011 and month sep....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i have to see sales of 2011 for jan to aug vs 2011 for sep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 09:22:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348299#M1175515</guid>
      <dc:creator />
      <dc:date>2012-04-12T09:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348300#M1175516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You can do the same for months.&lt;/P&gt;&lt;P&gt;Expand your set expression to include month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=max(Year))},Month={"$(=max(Month))"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={"$(=max(Year))"},Month={"&amp;lt;$(=max(Month))"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First expression&amp;nbsp; current Year and current Month&lt;/P&gt;&lt;P&gt;Second expression:&lt;/P&gt;&lt;P&gt; Current Year and Months less than current Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month must contain the Months part of a date. I.e It must be a dual value to work correct.&lt;/P&gt;&lt;P&gt;If Month just only contains the text part of the name t vill do a text comparisson and thats is not what you want...&lt;/P&gt;&lt;P&gt;As long as Month is declared as something&amp;nbsp; as Month = Month(&amp;lt;YourDate&amp;gt;); in script you propobly will be fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have the Monthsnumber in a field and want to use that insted, you could do that but you must cancel the month selection if you have some...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={$(=max(Year))},Month=,MonthNumber={"$(=max(MonthNumber))"}&amp;gt;} LineSalesAmount)&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={"$(=max(Year))"},Month=,MonthNumber={"&amp;lt;$(=max(MonthNumber))"}&amp;gt;} LineSalesAmount) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I use MonthNumber which is associated with Month.&lt;BR /&gt; But I use Month= , to cancel out Months influense on the expression since you use a $ as a set identifier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recomend you to study the set analysis portion of the help file. It can be where useful... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 09:39:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348300#M1175516</guid>
      <dc:creator />
      <dc:date>2012-04-12T09:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348301#M1175517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is showing the same values..on selecting may 2011&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 10:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348301#M1175517</guid>
      <dc:creator />
      <dc:date>2012-04-12T10:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348302#M1175518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do you have date field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;DateField={"&amp;gt;=$(=YearStart(Max(DateField)))&amp;lt;=$(=MonthEnd(Max(DateField),-1))"},Year=,Month=&amp;gt;} LineSalesAmount) //sales of 2011 for jan to aug&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;DateField={"&amp;gt;=$(=MonthStart(Max(DateField)))&amp;lt;=$(=MonthEnd(Max(DateField)))"},Year=,Month=&amp;gt;} LineSalesAmount)// 2011 for sep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 10:15:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348302#M1175518</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-04-12T10:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Compartively analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348303#M1175519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have order date field.....i have orderdate in place of date field .it is&amp;nbsp; working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 10:26:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compartively-analysis/m-p/348303#M1175519</guid>
      <dc:creator />
      <dc:date>2012-04-12T10:26:11Z</dc:date>
    </item>
  </channel>
</rss>

