<?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: ySales calculation based on xSales in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209725#M880819</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;Please find attached file for solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2016 05:38:44 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2016-10-11T05:38:44Z</dc:date>
    <item>
      <title>ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209718#M880812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have the two years of monthly data for 2015 and 2016.&lt;/P&gt;&lt;P&gt;When 2016 selected should show below results in two text boxes:&lt;/P&gt;&lt;P&gt;xSales=360 (sum of xSales from JAN-16 to AUG-16)&lt;/P&gt;&lt;P&gt;ySales=400 (sum of xSales from JAN-16 to AUG-16)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When 2015 selected should show below results:&lt;/P&gt;&lt;P&gt;xSales=705 (sum of xSales from JAN-15 to DEC-15)&lt;/P&gt;&lt;P&gt;ySales=860 (sum of ySales from JAN-15 to DEC-15)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;year(Month) as Year,Month(Month) as MonthName;&lt;/P&gt;&lt;P&gt;Load date#(Month,'MMM-YY') as Month,&lt;/P&gt;&lt;P&gt;Date(date#(Month,'MMM-YY')) as Date,&lt;/P&gt;&lt;P&gt;xSales,ySales inline [&lt;/P&gt;&lt;P&gt;Month,xSales,ySales&lt;/P&gt;&lt;P&gt;JAN-15,5,15&lt;/P&gt;&lt;P&gt;FEB-15,10,25&lt;/P&gt;&lt;P&gt;MAR-15,20,35&lt;/P&gt;&lt;P&gt;APR-15,30,45&lt;/P&gt;&lt;P&gt;MAY-15,40,55&lt;/P&gt;&lt;P&gt;JUN-15,50,65&lt;/P&gt;&lt;P&gt;JUL-15,60,75&lt;/P&gt;&lt;P&gt;AUG-15,70,85&lt;/P&gt;&lt;P&gt;SEP-15,80,95&lt;/P&gt;&lt;P&gt;OCT-15,100,105&lt;/P&gt;&lt;P&gt;NOV-15,110,125&lt;/P&gt;&lt;P&gt;DEC-15,130,135&lt;/P&gt;&lt;P&gt;JAN-16,10,15&lt;/P&gt;&lt;P&gt;FEB-16,20,25&lt;/P&gt;&lt;P&gt;MAR-16,30,35&lt;/P&gt;&lt;P&gt;APR-16,40,45&lt;/P&gt;&lt;P&gt;MAY-16,50,55&lt;/P&gt;&lt;P&gt;JUN-16,60,65&lt;/P&gt;&lt;P&gt;JUL-16,70,75&lt;/P&gt;&lt;P&gt;AUG-16,80,85&lt;/P&gt;&lt;P&gt;SEP-16,,95&lt;/P&gt;&lt;P&gt;OCT-16,,105&lt;/P&gt;&lt;P&gt;NOV-16,,125&lt;/P&gt;&lt;P&gt;DEC-16,,135&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;SalesDate:&lt;/P&gt;&lt;P&gt;load max(Month) as MaxDate&lt;/P&gt;&lt;P&gt;Resident DATA&lt;/P&gt;&lt;P&gt;where len(xSales)&amp;lt;&amp;gt;0&lt;/P&gt;&lt;P&gt;Order by Month desc;&lt;/P&gt;&lt;P&gt;Let vMaxDate=peek('MaxDate',0,'SalesDate');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209718#M880812</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209719#M880813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try these two expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Date = {"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(Date))) &amp;amp; '&amp;lt;=' &amp;amp; Date(RangeMin(Max(Date), MaxDate)))"}&amp;gt;} xSales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Date = {"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(Date))) &amp;amp; '&amp;lt;=' &amp;amp; Date(RangeMin(Max(Date), MaxDate)))"}&amp;gt;} ySales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:12:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209719#M880813</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-10T13:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209720#M880814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add one little piece, you might want to add this to you code, if you would like to see YTD based on your selection in Month or MonthName fields also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Date = {"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(Date))) &amp;amp; '&amp;lt;=' &amp;amp; Date(RangeMin(Max(Date), MaxDate)))"}&lt;SPAN style="color: #ff0000;"&gt;, Month, MonthName&lt;/SPAN&gt;&amp;gt;} xSales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum({&amp;lt;Date = {"$(='&amp;gt;=' &amp;amp; Date(YearStart(Max(Date))) &amp;amp; '&amp;lt;=' &amp;amp; Date(RangeMin(Max(Date), MaxDate)))"}&lt;STRONG style="color: #ff0000; font-size: 13.3333px;"&gt;, Month, MonthName&lt;/STRONG&gt;&amp;gt;} ySales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209720#M880814</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-10T13:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209721#M880815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;...or try the easy version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xSales: Sum(xSales)&lt;/P&gt;&lt;P&gt;ySales: Sum(Aggr(If(Sum(xSales) &amp;gt; 0, ySales), MonthName))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;happy qliking&lt;/P&gt;&lt;P&gt;Burkhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209721#M880815</guid>
      <dc:creator>veidlburkhard</dc:creator>
      <dc:date>2016-10-10T13:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209722#M880816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny, not sure why you are using &amp;amp; to concatenate the expression, you can just try&lt;/P&gt;&lt;DIV class="j-thread-post j-rc4"&gt;&lt;DIV&gt;&lt;STRONG&gt;=Sum({&amp;lt;Date = {"&amp;gt;=$(=Date(YearStart(Max(Date))) &amp;lt;=$(=Date(RangeMin(Max(Date), MaxDate)))"}&amp;gt;} xSales)=Sum({&amp;lt;Date = {"&amp;gt;=$(=Date(YearStart(Max(Date)))&amp;lt;=$(=Date(RangeMin(Max(Date), MaxDate)))"}&amp;gt;} ySales)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Jagan.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209722#M880816</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-10-10T13:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209723#M880817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its a great point, but I always use &amp;amp; function within the dollar sign expansion. The reason i do that is because, if every I want to check the range and/or format I am using within my set analysis, I can pick everything in between my dollar sign expansion and put it in a text box to see what I am getting. Its just saving myself from the trouble of working on it when I move this to a text box object. I know there are alternatives to do this, but this has become a habit and I find it very convenient to work with &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:51:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209723#M880817</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-10T13:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209724#M880818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh ok, this is not that much readable.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 14:06:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209724#M880818</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-10-10T14:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209725#M880819</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;Please find attached file for solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2016 05:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209725#M880819</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-10-11T05:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: ySales calculation based on xSales</title>
      <link>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209726#M880820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Expressions:&lt;/P&gt;&lt;P&gt;='Xsales = ' &amp;amp; Sum({&amp;lt;Date={'&amp;lt;=$(=Date(vMaxDate))'}&amp;gt;}xSales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='Ysales = ' &amp;amp; Sum({&amp;lt;Date={'&amp;lt;=$(=Date(vMaxDate))'}&amp;gt;}ySales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2016 05:39:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ySales-calculation-based-on-xSales/m-p/1209726#M880820</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2016-10-11T05:39:23Z</dc:date>
    </item>
  </channel>
</rss>

