<?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 How to set up modifier in a variable for a set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-set-up-modifier-in-a-variable-for-a-set-analysis/m-p/1369604#M30872</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;&lt;/P&gt;&lt;P&gt;Hope you are doing well!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a very tricky question regarding variables, parameters, modifiers and set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I have a variable to calculate the sales for different period (YTD, QTD, MTD), the variable vCalc_Sales = sum({&amp;lt;$($1)&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;2. When vCalc_Sales is used in the table measures, I am using the formula: $(vCalc_Sales(vSetQTD))&lt;/P&gt;&lt;P&gt;Basically, vSetQTD is the parameter that will pass in the calculation of vCalc_Sales&lt;/P&gt;&lt;P&gt;3. To set up the modifier inside the vCalc_Sales, the expression for vSetQTD is as follows:&lt;/P&gt;&lt;P&gt;vSetQTD='%PeriodID={"&amp;lt;='&amp;amp;Chr(36)&amp;amp;'(=MAX(%PeriodID)"},'&amp;amp;Chr(10)&amp;amp;'%QuarterID={'&amp;amp;CHR(36)&amp;amp;'(=max(%QuarterID))}'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%PeriodID is the monthID, and %QuarterID is QuarterID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I write the formula in the table $(vClac_Sales(vSetQTD)), everything returns to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone advise where I did wrong or how I should do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gloria&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 May 2017 20:16:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-05-31T20:16:20Z</dc:date>
    <item>
      <title>How to set up modifier in a variable for a set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-set-up-modifier-in-a-variable-for-a-set-analysis/m-p/1369604#M30872</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;&lt;/P&gt;&lt;P&gt;Hope you are doing well!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a very tricky question regarding variables, parameters, modifiers and set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I have a variable to calculate the sales for different period (YTD, QTD, MTD), the variable vCalc_Sales = sum({&amp;lt;$($1)&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;2. When vCalc_Sales is used in the table measures, I am using the formula: $(vCalc_Sales(vSetQTD))&lt;/P&gt;&lt;P&gt;Basically, vSetQTD is the parameter that will pass in the calculation of vCalc_Sales&lt;/P&gt;&lt;P&gt;3. To set up the modifier inside the vCalc_Sales, the expression for vSetQTD is as follows:&lt;/P&gt;&lt;P&gt;vSetQTD='%PeriodID={"&amp;lt;='&amp;amp;Chr(36)&amp;amp;'(=MAX(%PeriodID)"},'&amp;amp;Chr(10)&amp;amp;'%QuarterID={'&amp;amp;CHR(36)&amp;amp;'(=max(%QuarterID))}'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%PeriodID is the monthID, and %QuarterID is QuarterID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I write the formula in the table $(vClac_Sales(vSetQTD)), everything returns to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone advise where I did wrong or how I should do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gloria&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 20:16:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-set-up-modifier-in-a-variable-for-a-set-analysis/m-p/1369604#M30872</guid>
      <dc:creator />
      <dc:date>2017-05-31T20:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to set up modifier in a variable for a set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-set-up-modifier-in-a-variable-for-a-set-analysis/m-p/1369605#M30873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I first would try to set this expression in a table without title for the expression, then hovering the mouse over the column title you can check if it's expanded as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see a typo, the first max needs a parenthesys:&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;vSetQTD='%PeriodID={"&amp;lt;='&amp;amp;Chr(36)&amp;amp;'(=MAX(%PeriodID)&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;"}, %QuarterID={'&amp;amp;CHR(36)&amp;amp;'(=max(%QuarterID))}'&lt;/SPAN&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;&lt;BR /&gt;&lt;/SPAN&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;If still doesn't works I would try to wirte the expected expression in another column, when this expression works you only need to do you expression using variables to return a similar result when it's expanded.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 21:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-set-up-modifier-in-a-variable-for-a-set-analysis/m-p/1369605#M30873</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2017-05-31T21:56:21Z</dc:date>
    </item>
  </channel>
</rss>

