<?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: Understanding specific variables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373354#M30988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the helpful response. I have 2 more questions though :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How does in a Set Analysis the $(f.SetYTD(0)) give the Year to Date of this year, and the $(f.SetYTD(1)) give the Year to Date of past year? What part of the forumula does this and how does this work?&lt;/LI&gt;&lt;LI&gt;In the s.ClearCalanderFields, do I have it right that it'll always create at the end following part "[]=" (an empty field), does this have any impact on my data?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Oct 2017 06:29:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-02T06:29:08Z</dc:date>
    <item>
      <title>Understanding specific variables</title>
      <link>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373352#M30986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone made the following variable but I can't seem to interpret correctly how it works.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;s.ClearCalanderFields&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; : &lt;EM&gt;='['&amp;amp;concat({&amp;lt;$Table={'Calendar'}&amp;gt;}$Field,']=,[')&amp;amp;']='&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If I have a Table "Calander" with fields MonthYear, Year and MonthSerial_ in it, would the result be &lt;EM&gt;[MonthYear]=,[Year]=,[MonthSerial_]=,[]=&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;What does this variable exactly do? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;After that I have another variable &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;f.SetYTD&lt;/STRONG&gt;&amp;nbsp; : &lt;EM&gt;$(s.ClearCalendarFields),Year= {$(=max(Year)-$1)}, [MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-($1*12))"}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This starts with the previous Variable and adds some other elements : pick Max Year and pick max MonthSerial and the ones before it. How does this exectly work? What is the output?&lt;/P&gt;&lt;P&gt;The idea was to use this Variable in a Set Analysis like : sum( {&amp;lt;$(f.SetYTD(0)) &amp;gt;} Sales) to limit the data to only Year to Date Sales. When doing &lt;SPAN style="font-size: 13.3333px;"&gt;sum( {&amp;lt;$(f.SetYTD(1)) &amp;gt;} Sales) it would give the Year to Date Sales of the previous year. How does this mechanisme work that when i put 1 it gives the YtD sales of the previous year?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance for the help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 16:48:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373352#M30986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-29T16:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding specific variables</title>
      <link>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373353#M30987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first variable &lt;STRONG style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;s.ClearCalanderFields,&lt;/STRONG&gt; only gets the fields of the specified table, on your case Calendar, so by making that, you'll be able to tell that it has the&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;[MonthYear]&lt;/LI&gt;&lt;LI&gt;[Year]&lt;/LI&gt;&lt;LI&gt;[MonthSerial_]&lt;/LI&gt;&lt;LI&gt;[]&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second one, &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;f.SetYTD &lt;/STRONG&gt;is using the first one as clearing the fields on the set analysis that is used in an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, by expanding the dollar sign on the f.SetYTD variable, you'll get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[MonthYear]=,[Year]=,[MonthSerial_]=,[]=,Year= {$(=max(Year)-$1)}, [MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-($1*12))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what it's actually doing is ignoring the&lt;/P&gt;&lt;P&gt;[MonthYear]=,[Year]=,[MonthSerial_]=,[]=,Year=&lt;/P&gt;&lt;P&gt;fields, and then setting the others like:&lt;/P&gt;&lt;P&gt;Year= {$(=max(Year)-$1)}, [MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-($1*12))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my opinion, the first parameters shouldn't need to be duplicated, since you're setting them anyways, must be some logic to it, but i'm not seeing why they're duplicated, could be only something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[MonthYear]=,[]=,Year= {$(=max(Year)-$1)}, [MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-($1*12))"}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;(In this case, the [MonthYear]=,[]= would be ignored, while the other fields would be set according to the expression.&lt;/P&gt;&lt;P&gt;For example, if you want a sum of sales ignoring the fields of the calendar, you would do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;$(&lt;STRONG style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;s.ClearCalanderFields&lt;/STRONG&gt;)&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for year to date&lt;/P&gt;&lt;P&gt;sum({&amp;lt;$(&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;f.SetYTD&lt;/STRONG&gt;)&amp;gt;}Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 19:55:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373353#M30987</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-09-29T19:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding specific variables</title>
      <link>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373354#M30988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the helpful response. I have 2 more questions though :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How does in a Set Analysis the $(f.SetYTD(0)) give the Year to Date of this year, and the $(f.SetYTD(1)) give the Year to Date of past year? What part of the forumula does this and how does this work?&lt;/LI&gt;&lt;LI&gt;In the s.ClearCalanderFields, do I have it right that it'll always create at the end following part "[]=" (an empty field), does this have any impact on my data?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 06:29:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373354#M30988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-02T06:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding specific variables</title>
      <link>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373355#M30989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. This part of the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-(&lt;STRONG&gt;$1&lt;/STRONG&gt;*12))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;will get the parameter (in this case &lt;STRONG&gt;$1 &lt;/STRONG&gt;is a parameter you can input) and multiply it *12 and take it of the MonthSerial max, so in this case, if you do &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(f.SetYTD(0)) its, making &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-(0*12))"} // Getting the year to date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;as to &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;$(f.SetYTD(1))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[MonthSerial_] = {"&amp;lt;=$(=Max([MonthSerial_])-(1*12))"} // Getting the previous year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;and thus, giving the previous year amount.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. For the [] field, I can't quite understand what it does on your data model, maybe its a control flag of some sort.&lt;/P&gt;&lt;P&gt;See if there's any data for this field.&lt;/P&gt;&lt;P&gt;In my opinion if it's empty for all cases, it can be taken out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felipe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 12:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Understanding-specific-variables/m-p/1373355#M30989</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-10-02T12:48:41Z</dc:date>
    </item>
  </channel>
</rss>

