<?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: Advanced Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856726#M70710</link>
    <description>&lt;P&gt;Hi, if this works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;  Year= {"&amp;lt;=2020"}, Account= {"=(SUM( {&amp;lt;Year= {2020}&amp;gt;} Value)) &amp;gt; 0"}&amp;gt;} Value)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just using&amp;nbsp;&lt;SPAN&gt;=MAX(GJAHR) as the content for vJahr should work (the equal sign i'ts part of the variable content).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Have you tested what I said previously? Why/What are you trying to use vJahrTest? &lt;/SPAN&gt;vJahrTest =CHR(34)&amp;amp;Chr(36)&amp;amp;'(='&amp;amp;CHR(39)&amp;amp; '&amp;lt;='&amp;amp; CHR(39) &amp;amp; '&amp;amp;' &amp;amp;Chr(36)&amp;amp; '(vJahr)'&amp;amp;CHR(34)&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you open the expression editor, on the bar below you can see how Qlik it's expanding Values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The $( only means that it needs to solve expression inside each $( and once everything it's expanded it calculates the expression.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Nov 2021 06:52:47 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2021-11-09T06:52:47Z</dc:date>
    <item>
      <title>Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856523#M70690</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got a problem in syntax writing in a complex set analysis. For some reason i need to select a set of accounts that depends on the sum of values of certain years. The Formula how its written below works perfectly but it's not what i need at the end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Problem is the definition for the account, here I wrote&amp;nbsp;"Year= {$(vJahr)}" in fact I need the same as before "Year = {"&lt;U&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;=&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;$(vYear)" so that all values &lt;FONT color="#FF0000"&gt;&lt;U&gt;smaller than&lt;/U&gt; &lt;/FONT&gt;"vJahr" are accumulated. I tried several possibilities how i could write Year smaller the vJahr, but it won't work. As soon as i use smaller than, the formula does not calculate. Of course i could write a single variable for each year, which would work. It's just not a very elegant nor&amp;nbsp; clearly represented way of writing.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt; Year= {"&amp;lt;=$(vJahr)"}, 
Account= {"=(SUM( {&amp;lt;Year= {$(vJahr)}&amp;gt;} VALUE)) &amp;gt; 0"}&amp;gt;} VALUE)

//What I need (but doesn't work):
SUM({&amp;lt; Year= {"&amp;lt;=$(vJahr)"}, 
Account= {"=(SUM( {&amp;lt;Year= {'&amp;lt;='$(vJahr)}&amp;gt;} VALUE)) &amp;gt; 0"}&amp;gt;} VALUE)&lt;/LI-CODE&gt;
&lt;P&gt;Info: vJahr ist defined in the script as followed:&amp;nbsp; vJahr = CHR(36) &amp;amp; '(=MAX(GJAHR))' --&amp;gt; CHR(36) = "$"&lt;/P&gt;
&lt;P&gt;Further I tried to write the definiton in an other variable using the CHR() function, for example I defined a new Variable "vTest" and wrote as followed:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=CHR(34)&amp;amp;CHR(36)&amp;amp;'(='&amp;amp;CHR(39)&amp;amp;  '&amp;lt;='&amp;amp; CHR(39) &amp;amp; '&amp;amp;' &amp;amp; vJahr &amp;amp;')'&amp;amp;CHR(34)
//Result: =vTest: "$(='&amp;lt;='&amp;amp;$(=MAX(GJAHR)))"&lt;/LI-CODE&gt;
&lt;P&gt;Also this istn't working.&lt;/P&gt;
&lt;P&gt;Is it possible, that QlikView in this case can't&amp;nbsp; handle the small than (&amp;lt;=) in the "second" set anlalysis? For me its only important how to write the "&amp;lt;=" in the second part of the set analysis, what ist the correct sytax?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance for your help!&lt;/P&gt;
&lt;P&gt;Best regard&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 10:05:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856523#M70690</guid>
      <dc:creator>michael84</dc:creator>
      <dc:date>2021-11-08T10:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856532#M70692</link>
      <description>&lt;P&gt;Hi, if you define vJahr just as&amp;nbsp;&lt;SPAN&gt;=MAX(GJAHR) it should work.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If doesn't works you can also confirm that&amp;nbsp;=MAX(GJAHR) returns the value you expect, then try to edit your initial expression and instead of $(vJahr) write the number of the year to check if it works as expected.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 10:36:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856532#M70692</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-11-08T10:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856712#M70708</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I tried it in a diffferent ways, with 6 and also with a number (f.e. 2020) but non worked.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the statement that works, when vJahr ist defined as&amp;nbsp;$(=MAX(GJAHR))&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;  Year= {"&amp;lt;=$(vJahr)"}, Account= {"=(SUM( {&amp;lt;Year= {$(vJahr)}&amp;gt;} Value)) &amp;gt; 0"}&amp;gt;} Value)&lt;/LI-CODE&gt;
&lt;P&gt;If I define a new Variable f.e. vJahrTest and write as followed:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;vJahrTest =CHR(34)&amp;amp;'(='&amp;amp;CHR(39)&amp;amp; '&amp;lt;='&amp;amp; CHR(39) &amp;amp; '&amp;amp;' &amp;amp; (vJahr) &amp;amp;')'&amp;amp;CHR(34)&lt;/LI-CODE&gt;
&lt;P&gt;this returns&amp;nbsp;&lt;BR /&gt;"(='&amp;lt;='&amp;amp;(=MAX(GJAHR)))", does not work (with or without $.&lt;/P&gt;
&lt;P&gt;If I replace&amp;nbsp; (vJahr) with 2020&amp;nbsp; (--&amp;gt; "(='&amp;lt;='2020)" or if I add a "$" doesn't change a thing.&lt;/P&gt;
&lt;P&gt;As soon as there is "&amp;lt;=" its not working. Is it possible that Qlik really can't handle this set analysis in an existing set analysis?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 15:37:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856712#M70708</guid>
      <dc:creator>michael84</dc:creator>
      <dc:date>2021-11-08T15:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856726#M70710</link>
      <description>&lt;P&gt;Hi, if this works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;  Year= {"&amp;lt;=2020"}, Account= {"=(SUM( {&amp;lt;Year= {2020}&amp;gt;} Value)) &amp;gt; 0"}&amp;gt;} Value)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just using&amp;nbsp;&lt;SPAN&gt;=MAX(GJAHR) as the content for vJahr should work (the equal sign i'ts part of the variable content).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Have you tested what I said previously? Why/What are you trying to use vJahrTest? &lt;/SPAN&gt;vJahrTest =CHR(34)&amp;amp;Chr(36)&amp;amp;'(='&amp;amp;CHR(39)&amp;amp; '&amp;lt;='&amp;amp; CHR(39) &amp;amp; '&amp;amp;' &amp;amp;Chr(36)&amp;amp; '(vJahr)'&amp;amp;CHR(34)&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you open the expression editor, on the bar below you can see how Qlik it's expanding Values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The $( only means that it needs to solve expression inside each $( and once everything it's expanded it calculates the expression.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 06:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1856726#M70710</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-11-09T06:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1857614#M70793</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Maybe i didn't discribed the problem properly. What I need ist the follwoing formula:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUM({&amp;lt;  Year= {"&amp;lt;=$(vJahr)"}, Account= {"=SUM( {&amp;lt;Year= {"&amp;lt;=$(vJahr)"}&amp;gt;} Value) &amp;gt; 0"}&amp;gt;} Value)&lt;/LI-CODE&gt;
&lt;P&gt;The failure in this formula is red marked:&lt;/P&gt;
&lt;P&gt;SUM({&amp;lt; Year= {"&amp;lt;=$(vJahr)"}, Account= {"=SUM( {&amp;lt;Year= {&lt;FONT color="#FF0000"&gt;"&amp;lt;=$(vJahr)"&lt;/FONT&gt;}&amp;gt;} Value) &amp;gt; 0"}&amp;gt;} Value)&lt;/P&gt;
&lt;P&gt;It must be smaller or bigger than so I can't let the "&amp;lt;" or "&amp;gt;" away, but exactly these two operators are the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe this might help to solve the problem...&lt;/P&gt;
&lt;P&gt;Thanks again for helping me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 12:17:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1857614#M70793</guid>
      <dc:creator>michael84</dc:creator>
      <dc:date>2021-11-10T12:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1857631#M70795</link>
      <description>&lt;P&gt;Hi, I think your issue here is that the double quotes, the first double quote of&amp;nbsp;&lt;SPAN&gt;"&amp;lt;=$(vJahr)" is closing the&amp;nbsp;"=SUM double quote, try to use double-double quotes to avoid this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=SUM({&amp;lt; Year= {"&amp;lt;=$(vJahr)"}, Account= {"=SUM( {&amp;lt;Year= {&lt;FONT color="#FF0000"&gt;""&lt;/FONT&gt;&amp;lt;=$(vJahr)&lt;FONT color="#FF0000"&gt;""&lt;/FONT&gt;}&amp;gt;} Value) &amp;gt; 0"}&amp;gt;} Value)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tested with this data&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD * INLINE [
Year, Account, Value
2019,1,2
2020,1,5
2021,1,-10
2019,2,3
2020,2,7
2021,2,5
];&lt;/LI-CODE&gt;
&lt;P&gt;and vJahr as&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Max(Year)&lt;/LI-CODE&gt;
&lt;P&gt;If I select 2020 it returns 17 (7 for account 1 and 10 for account 2), if i select 2021 or nothing it returns 15 (from account 1)&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 12:45:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1857631#M70795</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-11-10T12:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1857755#M70809</link>
      <description>&lt;P&gt;Perfect, the correct solution is the double-double quote!&lt;/P&gt;
&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 15:09:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Advanced-Set-Analysis/m-p/1857755#M70809</guid>
      <dc:creator>michael84</dc:creator>
      <dc:date>2021-11-10T15:09:52Z</dc:date>
    </item>
  </channel>
</rss>

