<?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 Set Analyses with Nested If in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1710173#M63909</link>
    <description>&lt;P&gt;Hi all'ya guru's&lt;/P&gt;&lt;P&gt;I'm trying to shorten the following set analyses statement:&lt;/P&gt;&lt;P&gt;if(vPeriod='YTD',&lt;BR /&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"&amp;lt;=$(vFiscalPPP)"} &amp;gt;} ton ),&lt;BR /&gt;if(vPeriod='MTD',&lt;BR /&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"$(vFiscalPPP)"} &amp;gt;} ton )&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have tried the following as an example, but not working:&lt;/P&gt;&lt;P&gt;sum({&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal ={"$(=pick(match($(vPeriod),'YTD','MTD'),{"&amp;lt;=$(vFiscalPPP)"},{"$(vFiscalPPP)"}))" } &amp;gt;} ton )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have an idea of what the correct syntax should be or alternative function to use to bring it all under the same sum()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 08:28:41 GMT</pubDate>
    <dc:creator>Jan-Hendrik</dc:creator>
    <dc:date>2021-04-02T08:28:41Z</dc:date>
    <item>
      <title>Set Analyses with Nested If</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1710173#M63909</link>
      <description>&lt;P&gt;Hi all'ya guru's&lt;/P&gt;&lt;P&gt;I'm trying to shorten the following set analyses statement:&lt;/P&gt;&lt;P&gt;if(vPeriod='YTD',&lt;BR /&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"&amp;lt;=$(vFiscalPPP)"} &amp;gt;} ton ),&lt;BR /&gt;if(vPeriod='MTD',&lt;BR /&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"$(vFiscalPPP)"} &amp;gt;} ton )&lt;BR /&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have tried the following as an example, but not working:&lt;/P&gt;&lt;P&gt;sum({&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal ={"$(=pick(match($(vPeriod),'YTD','MTD'),{"&amp;lt;=$(vFiscalPPP)"},{"$(vFiscalPPP)"}))" } &amp;gt;} ton )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have an idea of what the correct syntax should be or alternative function to use to bring it all under the same sum()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1710173#M63909</guid>
      <dc:creator>Jan-Hendrik</dc:creator>
      <dc:date>2021-04-02T08:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analyses with Nested If</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1717942#M63910</link>
      <description>&lt;P&gt;maybe this:&lt;/P&gt;&lt;P&gt;=sum( {&amp;lt; &lt;STRONG&gt;vPeriod&lt;/STRONG&gt; = {'YTD'}, yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"&amp;lt;=$(vFiscalPPP)"} &amp;gt;} ton )&lt;BR /&gt;+&lt;BR /&gt;sum( {&amp;lt; &lt;STRONG&gt;vPeriod&lt;/STRONG&gt; = {'MTD'}, yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"$(vFiscalPPP)"} &amp;gt;} ton )&lt;/P&gt;&lt;P&gt;replacing vPeriod with the field name.&lt;/P&gt;&lt;P&gt;I hope it can helps.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 13:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1717942#M63910</guid>
      <dc:creator>agigliotti</dc:creator>
      <dc:date>2020-06-11T13:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analyses with Nested If</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1717985#M63911</link>
      <description>&lt;P&gt;Usually, if the only difference in an expression is a single piece of text, you can leverage the variable to change the meaning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your example, the only difference is highlighted below in the two conditions:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(vPeriod='YTD',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;&amp;lt;=&lt;/STRONG&gt;&lt;/FONT&gt;$(vFiscalPPP)"} &amp;gt;} ton ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(vPeriod='MTD',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"$(vFiscalPPP)"} &amp;gt;} ton )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I would change the whole expression to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum( {&amp;lt; yyyyFiscal={"$(vFiscalYYYY)"}, pppFiscal={"&lt;FONT color="#FF6600"&gt;$(vPeriodCondition)&lt;/FONT&gt;$(vFiscalPPP)"} &amp;gt;} ton )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Where vPeriodCondition = '&amp;lt;=' for YTD or '' for MTD.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 15:06:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1717985#M63911</guid>
      <dc:creator>treysmithdev</dc:creator>
      <dc:date>2020-06-11T15:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analyses with Nested If</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1718126#M63912</link>
      <description>&lt;P&gt;Awesome, thanks, that did the trick&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 01:24:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analyses-with-Nested-If/m-p/1718126#M63912</guid>
      <dc:creator>Jan-Hendrik</dc:creator>
      <dc:date>2020-06-12T01:24:11Z</dc:date>
    </item>
  </channel>
</rss>

