<?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 and alternate State in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100565#M18579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks you Sunny it works !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second issue wasn't a problem, i have created a variable with this code :&lt;/P&gt;&lt;P&gt;$(vClearCalendar), [Year] = {$(=Max({SelDate} [Année])-$1)}, [_DaySerialYear] = {"&amp;lt;=$(=Max({SelDate}[_DaySerialYear])) &amp;gt;=$(=Min({SelDate}[_DaySerialYear]))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This variable take one argument. When i use this variable in a formula, It's calculated the value for the same period of date for a previous year (argument)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Stephane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jul 2016 07:49:11 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-07-22T07:49:11Z</dc:date>
    <item>
      <title>Set analysis and alternate State</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100563#M18577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Hello I am new in QlikSense and I need your help &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;I have Products, Sales and a Calendar on SalesDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;I need a table to show product Name,sku,brand,..., sales on a period, Sales on the same period previous year &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;The criteria on calendar's fields should not filter my selection ! in fact if I choose year&amp;nbsp; 2016, i want to see in my table products sold in 2015 too&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;So i have create an alternate state [SelDate] and assign "the Date Selection" to this Alternate State.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;I've created a new &lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;measure like this : sum({&amp;lt;[Year]={$(=Max([Year])-1)}&amp;gt;} [Sales.Qty]*[&lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;Sales&lt;/SPAN&gt;.Price]) , it's ok --&amp;gt; if have the amount for 2015 because i have no selection on date, so the max date = 2016 - 1 = 2015. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;So i want to to have the max date from my alternate state : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;Sum({&amp;lt;[Year]={$(=Max(&lt;SPAN style="color: #ff0000;"&gt;[SelDate]::&lt;/SPAN&gt;[Year])-1)}&amp;gt;} [Sales.Qty]*[&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;.Price])&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;but it's return 0. Syntax problem ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;My final goal it's to create a variable with one argument, like this variable for my alternate state :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;$(vClearCalendar), [&lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;Year&lt;/SPAN&gt;] = {$(=Max([&lt;SPAN style="font-family: arial, sans-serif; font-size: 13px;"&gt;Year&lt;/SPAN&gt;])-$1)}, [_DaySerialYear] = {"&amp;lt;=$(=Max([_DaySerialYear])) &amp;gt;=$(=Min([_DaySerialYear]))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: arial, sans-serif;"&gt;_DaySerialYear is a field added in the calendar = Month *100 + Day to manage correctly 29th of February.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;vClearCalendar is another variable to reset all calendar criteria ='['&amp;amp; Concat(distinct {1&amp;lt;$Table={'Calendrier'}&amp;gt;}$Field, ']=, [')&amp;amp;']='&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-family: arial, sans-serif; font-size: 13px;"&gt;Someone can help me solve my problem ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Stephane&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 14:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100563#M18577</guid>
      <dc:creator />
      <dc:date>2016-07-19T14:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and alternate State</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100564#M18578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this for your first issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;Sum({&amp;lt;[Year]={$(=Max(&lt;SPAN style="color: #ff0000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit; color: #ff0000;"&gt;SelDate} &lt;/SPAN&gt;Year)-1)}&amp;gt;} [Sales.Qty]*[&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: arial, sans-serif;"&gt;Sales&lt;/STRONG&gt;&lt;SPAN style="font-size: 13px; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;.Price])&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you elaborate a little more for your second issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 17:12:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100564#M18578</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-19T17:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and alternate State</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100565#M18579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks you Sunny it works !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second issue wasn't a problem, i have created a variable with this code :&lt;/P&gt;&lt;P&gt;$(vClearCalendar), [Year] = {$(=Max({SelDate} [Année])-$1)}, [_DaySerialYear] = {"&amp;lt;=$(=Max({SelDate}[_DaySerialYear])) &amp;gt;=$(=Min({SelDate}[_DaySerialYear]))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This variable take one argument. When i use this variable in a formula, It's calculated the value for the same period of date for a previous year (argument)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Stephane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2016 07:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-and-alternate-State/m-p/1100565#M18579</guid>
      <dc:creator />
      <dc:date>2016-07-22T07:49:11Z</dc:date>
    </item>
  </channel>
</rss>

