<?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 help with expression with dynamic variables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050724#M86370</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;Can anyone help me with the expression - I want to compare values of CurrentFY and PreviousFY.&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;[Departure Date.FinancialYear]={"&amp;gt;=vPreviousFY&amp;lt;=vCurrentFY"}&amp;gt;}[ToC Numerator])/Sum({&amp;lt;[Departure Date.FinancialYear]={"&amp;gt;=vPreviousFY&amp;lt;=vCurrentFY"}&amp;gt;}[ToC Denominator])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NB: vCurrentFY =&lt;/P&gt;
&lt;P&gt;=If(Num(Month(Today())-1)&amp;gt;6,Year(Today())&amp;amp;'/'&amp;amp;Year(addmonths(Today(),12)),Year(Addmonths(Today(),-12))&amp;amp;'/'&amp;amp;Year(Today()))&lt;/P&gt;
&lt;P&gt;value is 2022/2023&lt;/P&gt;
&lt;P&gt;vPreviousFY =&lt;/P&gt;
&lt;P&gt;=If(Num(Month(Today())-1)&amp;gt;6,Year(Addmonths(Today(),-12))&amp;amp;'/'&amp;amp;Year(addmonths(Today(),24)),Year(Addmonths(Today(),-24))&amp;amp;'/'&amp;amp;Year(Addmonths(Today(),-12)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;value is&amp;nbsp;2021/2022&lt;/P&gt;</description>
    <pubDate>Sun, 19 Mar 2023 00:06:38 GMT</pubDate>
    <dc:creator>ashmitp869</dc:creator>
    <dc:date>2023-03-19T00:06:38Z</dc:date>
    <item>
      <title>help with expression with dynamic variables</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050724#M86370</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;Can anyone help me with the expression - I want to compare values of CurrentFY and PreviousFY.&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;[Departure Date.FinancialYear]={"&amp;gt;=vPreviousFY&amp;lt;=vCurrentFY"}&amp;gt;}[ToC Numerator])/Sum({&amp;lt;[Departure Date.FinancialYear]={"&amp;gt;=vPreviousFY&amp;lt;=vCurrentFY"}&amp;gt;}[ToC Denominator])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NB: vCurrentFY =&lt;/P&gt;
&lt;P&gt;=If(Num(Month(Today())-1)&amp;gt;6,Year(Today())&amp;amp;'/'&amp;amp;Year(addmonths(Today(),12)),Year(Addmonths(Today(),-12))&amp;amp;'/'&amp;amp;Year(Today()))&lt;/P&gt;
&lt;P&gt;value is 2022/2023&lt;/P&gt;
&lt;P&gt;vPreviousFY =&lt;/P&gt;
&lt;P&gt;=If(Num(Month(Today())-1)&amp;gt;6,Year(Addmonths(Today(),-12))&amp;amp;'/'&amp;amp;Year(addmonths(Today(),24)),Year(Addmonths(Today(),-24))&amp;amp;'/'&amp;amp;Year(Addmonths(Today(),-12)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;value is&amp;nbsp;2021/2022&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2023 00:06:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050724#M86370</guid>
      <dc:creator>ashmitp869</dc:creator>
      <dc:date>2023-03-19T00:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: help with expression with dynamic variables</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050773#M86373</link>
      <description>&lt;P&gt;try using :&lt;BR /&gt;$(=variable) or $(variable)&lt;BR /&gt;in set expression.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2023 16:09:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050773#M86373</guid>
      <dc:creator>Gabbar</dc:creator>
      <dc:date>2023-03-19T16:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: help with expression with dynamic variables</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050787#M86375</link>
      <description>&lt;P&gt;It looks like you are trying to compare values from the CurrentFY and PreviousFY for the given expression. However, the comparison expression in the set analysis is not correct.&lt;/P&gt;
&lt;P&gt;The correct set analysis expression for comparing the values of CurrentFY and PreviousFY should be:&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;[Departure Date.FinancialYear]={"&amp;gt;=$(vPreviousFY)&amp;lt;=$(vCurrentFY)"}&amp;gt;}[ToC Numerator])/Sum({&amp;lt;[Departure Date.FinancialYear]={"&amp;gt;=$(vPreviousFY)&amp;lt;=$(vCurrentFY)"}&amp;gt;}[ToC Denominator])&lt;/P&gt;
&lt;P&gt;Here, we have replaced the "&amp;lt;=" operator with "&amp;lt;= $ " and "&amp;gt;= $ " which is the correct syntax for comparing values with variables in set analysis. Also, we have swapped the order of CurrentFY and PreviousFY in the comparison operator, as we want to select the data where the FinancialYear is between vPreviousFY and vCurrentFY.&lt;/P&gt;
&lt;P&gt;Please try this updated expression and let me know if it works for you.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2023 18:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-expression-with-dynamic-variables/m-p/2050787#M86375</guid>
      <dc:creator>jdurmus</dc:creator>
      <dc:date>2023-03-19T18:15:23Z</dc:date>
    </item>
  </channel>
</rss>

