<?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 sum a different field deppending on a variable value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643617#M47993</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a set expression to calculate different things deppending on the value of a variable. For example:&lt;/P&gt;&lt;P&gt;this is the formula:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}Cerveza_754)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The field to sum is named "Cerveza_754" because we are calculating the category "754". When I selected the category 754, a variable is stored as "754",&amp;nbsp;But I want to sum Cerveza_800 or Cerveza_900 too&lt;/P&gt;&lt;P&gt;I build a variable named "Categoria_Label" that concatenate "Cerveza_"&amp;amp;Category and the Variable result is good, but when I put it in the formula did not works&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}$(Categoria_Label))&lt;/LI-CODE&gt;&lt;P&gt;Is it possible to do something like I'm trying to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 09:55:18 GMT</pubDate>
    <dc:creator>ecabanas</dc:creator>
    <dc:date>2019-11-06T09:55:18Z</dc:date>
    <item>
      <title>sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643617#M47993</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a set expression to calculate different things deppending on the value of a variable. For example:&lt;/P&gt;&lt;P&gt;this is the formula:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}Cerveza_754)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The field to sum is named "Cerveza_754" because we are calculating the category "754". When I selected the category 754, a variable is stored as "754",&amp;nbsp;But I want to sum Cerveza_800 or Cerveza_900 too&lt;/P&gt;&lt;P&gt;I build a variable named "Categoria_Label" that concatenate "Cerveza_"&amp;amp;Category and the Variable result is good, but when I put it in the formula did not works&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}$(Categoria_Label))&lt;/LI-CODE&gt;&lt;P&gt;Is it possible to do something like I'm trying to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 09:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643617#M47993</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2019-11-06T09:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643624#M47995</link>
      <description>&lt;P&gt;Tell us the exact expression for variable? "&lt;SPAN&gt;$(Categoria_Label)&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 10:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643624#M47995</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-11-06T10:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643677#M48004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable is build concatenating text and the category value:&amp;nbsp;&amp;nbsp;= 'Categoria_' &amp;amp; Catlevel2&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:00:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643677#M48004</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2019-11-06T11:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643699#M48006</link>
      <description>&lt;P&gt;Are you sure you only have one available value for &lt;FONT face="courier new,courier"&gt;Catlevel2&lt;/FONT&gt;?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on the definition of your variable you can try adjusting it like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}[$(=Categoria_Label)])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}[$(=$(Categoria_Label))])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643699#M48006</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-11-06T11:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643705#M48007</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/25001"&gt;@Vegar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did not works, thank's&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:29:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643705#M48007</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2019-11-06T11:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643715#M48008</link>
      <description>&lt;P&gt;Are you sure that your variable is producing the field name that you want to use? Try displaying the output of the variable in a Diagram object.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:41:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643715#M48008</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-11-06T11:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643718#M48009</link>
      <description>&lt;P&gt;It seems is ok:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-11-06_12h45_33.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23004iD17B7C4113FA01B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-11-06_12h45_33.png" alt="2019-11-06_12h45_33.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:46:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643718#M48009</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2019-11-06T11:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643744#M48012</link>
      <description>&lt;P&gt;In your example that is working you are reffering to&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Cerveza_754&lt;/FONT&gt;, but in the picture you are presenting&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Categoria_754.&amp;nbsp;&lt;/FONT&gt;Could this be the issue?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 12:46:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643744#M48012</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-11-06T12:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643988#M48038</link>
      <description>&lt;P&gt;Variables can take parameters, so maybe:&amp;nbsp;&lt;/P&gt;&lt;P&gt;vCerveza&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=(sum({&amp;lt;CalendarYear_C =,CalendarMonthName_C=,CalendarMonthAndYear_C={"&amp;gt;=$(=addmonths(max(CalendarMonthAndYear_C),-12)) &amp;lt;=$(=Max(CalendarMonthAndYear_C))"}&amp;gt;}Cerveza_$1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=($(vCerveza(754))&amp;nbsp;&lt;/P&gt;&lt;P&gt;=($(vCerveza(800))&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 20:56:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1643988#M48038</guid>
      <dc:creator>dwforest</dc:creator>
      <dc:date>2019-11-06T20:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1644190#M48049</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50153"&gt;@dwforest&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm so sorry, but I don't understand what you want to say...why you use Cerveza_$1? what does it mean?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really apreciate your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eduard&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 11:06:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1644190#M48049</guid>
      <dc:creator>ecabanas</dc:creator>
      <dc:date>2019-11-07T11:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: sum a different field deppending on a variable value</title>
      <link>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1644444#M48061</link>
      <description>&lt;P&gt;$1 in a variable refers to parameter 1&lt;/P&gt;&lt;P&gt;($(&lt;SPAN&gt;Cerveza(800))) calls the variable&amp;nbsp;Cerveza and passes 800 as the first parameter&amp;nbsp; (all the parens are necessary btw)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the variable definition the $1 would be replaced by 800 in this example. Note that the formula editor will say $1 is a bad name and/or that the formula is invalid. Create the formula with a hard coded value initially to validate the syntax, then replace the part to be dynamic with $1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Of course you can pass more values and they would be $2, $3, etc&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 17:43:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/sum-a-different-field-deppending-on-a-variable-value/m-p/1644444#M48061</guid>
      <dc:creator>dwforest</dc:creator>
      <dc:date>2019-11-07T17:43:27Z</dc:date>
    </item>
  </channel>
</rss>

