<?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: Set Analysis - Nested Formula not working in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107054#M90421</link>
    <description>&lt;P&gt;Within your count-condition the set analysis is missing the double-quotes wrapping - so it might be just a small syntax-issue.&lt;/P&gt;
&lt;P&gt;If it's not the cause it would be quite difficult to say why it didn't returned your expected results - without a deeper view on the data and their relationship within the data-model and also the dimensional context in which the expression is performed.&lt;/P&gt;
&lt;P&gt;Personally I suggest to avoid such logic because your inner count-condition isn't a real set analysis anymore because it means to perform a row-level evaluation while a classical set analysis is a column-level evaluation like a selection. It's more or less an if-loop in a set analysis syntax. It will work in many cases but without the performance-benefit which a classical set analysis has against an if-loop. More logically and often simpler would be to apply such kind of condition in beforehand or afterwards instead in the middle, for example with something like:&lt;/P&gt;
&lt;P&gt;if(count() &amp;gt; X, MyExpression)&lt;/P&gt;
&lt;P&gt;or maybe&lt;/P&gt;
&lt;P&gt;MyExpression * -(count() &amp;gt; X)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 09:06:23 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-08-18T09:06:23Z</dc:date>
    <item>
      <title>Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106735#M90374</link>
      <description>&lt;P&gt;Hey Qlikkers,&lt;/P&gt;
&lt;P&gt;I have a set expression which should count medical cases based on some conditions and over several years - out of that, I wanna make a sparkline in my table later.&lt;/P&gt;
&lt;P&gt;The "easy" version of the formular works:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{$&amp;lt;Leistungskatalog = {"*"}, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;BewegungJahr = {"&amp;gt;=$(vMinYear)&amp;lt;=$(vMaxYear)"}, BewegungMonat = , BewegungQuartal = &amp;gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DISTINCT Fallnummer)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now if I add another filter which should filter the cases by the fact if they received at least one billable treatment, the formula suddenly returns 0 for every dimension:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; Count(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{$&amp;lt;Leistungskatalog = {"*"}, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;BewegungJahr = {"&amp;gt;=$(vMinYear)&amp;lt;=$(vMaxYear)"}, &lt;FONT color="#FF0000"&gt;FallBewegungKey = {"=Count({$&amp;lt;BewegungJahr = {&amp;gt;=$(vMinYear)&amp;lt;=$(vMaxYear)}&amp;gt;} ICD) &amp;gt; 0"} &amp;gt;&lt;/FONT&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DISTINCT Fallnummer)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; If I insert a single year&amp;nbsp; inside the Count set expression (like&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt; {"=Count({$&amp;lt;BewegungJahr = {2021}}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;) then it works without problems - so the issue here seems to be the variable timespan.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Any idea what I'm doing wrong here?&lt;/P&gt;
&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106735#M90374</guid>
      <dc:creator>alliedarmour</dc:creator>
      <dc:date>2023-08-18T08:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106776#M90379</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/237020"&gt;@alliedarmour&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The syntax you use to search seems to be fine. Can you provide more information about the output? Are you getting nulls or an erroneous value?&lt;/P&gt;
&lt;P&gt;Remember that the Count of &lt;STRONG&gt;ICD&amp;nbsp;&lt;/STRONG&gt;respects the outer selection.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 13:29:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106776#M90379</guid>
      <dc:creator>pcv_devo</dc:creator>
      <dc:date>2023-08-17T13:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106848#M90396</link>
      <description>&lt;P&gt;It might be that you do not need the count and a simplified condition would be enough, like:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Count(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{$&amp;lt;Leistungskatalog = {"*"},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;BewegungJahr = {"&amp;gt;=$(vMinYear)&amp;lt;=$(vMaxYear)"},&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;ICD&amp;nbsp; {"*"} &amp;gt;&lt;/FONT&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DISTINCT Fallnummer)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 16:11:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106848#M90396</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-17T16:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106993#M90415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/177397"&gt;@pcv_devo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I'm just getting 0 (zero), not erroneous values - but I double checked the cases in a seperate table if there are any ICDs and there are - so they should've been included by the set expression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 06:56:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2106993#M90415</guid>
      <dc:creator>alliedarmour</dc:creator>
      <dc:date>2023-08-18T06:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107027#M90418</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;thanks for your reply - that should indeed work, but my goal is to understand why my expression (even if it is slightly more complex) &lt;STRONG&gt;doesn't&lt;/STRONG&gt; work&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&amp;nbsp;. It should give me the same result, but I want to really understand why it fails.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 08:18:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107027#M90418</guid>
      <dc:creator>alliedarmour</dc:creator>
      <dc:date>2023-08-18T08:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107053#M90420</link>
      <description>&lt;P&gt;Okay, it looks like I found the error:&lt;/P&gt;
&lt;P&gt;FallBewegungKey = {"=Count({&amp;lt;BewegungJahr = {&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;""&lt;/STRONG&gt;&lt;/FONT&gt;&amp;gt;=$(vMinYear)&amp;lt;=$(vMaxYear)&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;""&lt;/STRONG&gt;&lt;/FONT&gt;}&amp;gt;} [ICD-Code]) &amp;gt; 0"}&lt;/P&gt;
&lt;P&gt;It looks like you need two pairs of double quotes so Qlik interpretes it as string correctly. I also tried with single quoted, but that wouldn't work - at least in my case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 09:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107053#M90420</guid>
      <dc:creator>alliedarmour</dc:creator>
      <dc:date>2023-08-18T09:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107054#M90421</link>
      <description>&lt;P&gt;Within your count-condition the set analysis is missing the double-quotes wrapping - so it might be just a small syntax-issue.&lt;/P&gt;
&lt;P&gt;If it's not the cause it would be quite difficult to say why it didn't returned your expected results - without a deeper view on the data and their relationship within the data-model and also the dimensional context in which the expression is performed.&lt;/P&gt;
&lt;P&gt;Personally I suggest to avoid such logic because your inner count-condition isn't a real set analysis anymore because it means to perform a row-level evaluation while a classical set analysis is a column-level evaluation like a selection. It's more or less an if-loop in a set analysis syntax. It will work in many cases but without the performance-benefit which a classical set analysis has against an if-loop. More logically and often simpler would be to apply such kind of condition in beforehand or afterwards instead in the middle, for example with something like:&lt;/P&gt;
&lt;P&gt;if(count() &amp;gt; X, MyExpression)&lt;/P&gt;
&lt;P&gt;or maybe&lt;/P&gt;
&lt;P&gt;MyExpression * -(count() &amp;gt; X)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 09:06:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107054#M90421</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-18T09:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Nested Formula not working</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107060#M90422</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;as I stated in last answer the missing double quotes were the issue indeed.&lt;/P&gt;
&lt;P&gt;I'm quite new to Qlik so thanks a bunch for your explanation, that helps me a lot! Will consider this when refining the application&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;Have a nice weekend!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 09:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Nested-Formula-not-working/m-p/2107060#M90422</guid>
      <dc:creator>alliedarmour</dc:creator>
      <dc:date>2023-08-18T09:22:26Z</dc:date>
    </item>
  </channel>
</rss>

