<?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 - Handling complexities - Arithmetic, Fields, Variables, Variables within variables, Greater than etc in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459157#M36036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would recommend to try something like this:&lt;/P&gt;&lt;P&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;=SUM({&amp;lt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;UniqueRowID&lt;/STRONG&gt;&lt;/SPAN&gt;={&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #339966;"&gt;"&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;=[Size] &amp;gt;= $(vMinSOS) AND &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;[Size] - ((([Heads] * IF([SPD] &amp;gt;= $(vMaxSUSPD), $(vMaxSUSPD), [SPD])) / $(vSUR)) + ([Size] * $(vSOR))) &amp;gt;= 0&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;}&amp;gt;} [Size] )&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #f70737;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;When doing a search like this it will pick rows from the underlying rowset. That is why you should have a field that is a unique row ID to pick the right rows to be used by the aggregation function. Maybe you already have one - if not create one in the load script. Even just a RowNo() will do as a row id in the right load statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2018 19:57:31 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2018-01-04T19:57:31Z</dc:date>
    <item>
      <title>Set Analysis - Handling complexities - Arithmetic, Fields, Variables, Variables within variables, Greater than etc</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459156#M36035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am somewhat new to QlikSense, but am getting a hang of it. Set Analysis is probably my weak spot and no matter how much I read, I tend to forget everything within hours. Plus, the guides don't do a great job explaining how to handle more complex/'tricky' situations (aka Level II or III complexity) than what they deem complex (aka Level 1 complexity) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I went through &lt;A href="http://livingqlikview.com/livingqlik-roots-the-ultimate-qlikview-set-analysis-reference/"&gt;this&lt;/A&gt;, &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2015/02/16/set-analysis"&gt;this&lt;/A&gt; and &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4889"&gt;this&lt;/A&gt;, still no dice. The only thing left for me to do is to bang my head to the wall and see if something shakes up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual file is pretty big and proprietary, so can't post it here... so I would appreciate if you can give me an idea and point me in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GOAL:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an expression that works, but I need it in the form of set analysis. Simple, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BACKGROUND:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//IN LOAD SCRIPT - set some default values&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;SET dMinSOS = 20000;&lt;/P&gt;&lt;P&gt;SET dMaxSUSPD = 225;&lt;/P&gt;&lt;P&gt;SET dSUR = 1;&lt;/P&gt;&lt;P&gt;SET dSOR = 0.3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//IN LOAD SCRIPT - generate some custom inputs so user can select a value&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;FOR i = 1 to 20&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET counter = i*5000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Min. SOS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(counter)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ];&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = 0 to 9&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET counter = i/10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(counter)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ];&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = 1 to 30&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET counter = i/10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(counter)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ];&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = 1 to 15&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET counter = i*25;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max. SUSPD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(counter)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ];&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//IN LOAD SCRIPT - if user selects a value from above, then get the max because they can select multiple; otherwise use default values&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;SET vMinSOS = "IF(ISNULL([Min. SOS]), $(dMinSOS), MAX([Min. SOS]))";&lt;/P&gt;&lt;P&gt;SET vMaxSUSPD = "IF(ISNULL([Max. SUSPD]), $(dMaxSUSPD), MAX([Max. SUSPD]))";&lt;/P&gt;&lt;P&gt;SET vSUR = "IF(ISNULL([SUR]), $(dSUR), MAX([SUR]))";&lt;/P&gt;&lt;P&gt;SET vSOR = "IF(ISNULL([SOR]), $(dSOR), MAX([SOR]))";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//EXPRESSION - works! - [Size], [Heads], [SPD] are direct fields in a table, the return value of 1 or 0 is strictly for reference&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;=IF(&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;[Size] &amp;gt;= $(vMinSOS) AND &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #f70737;"&gt;&lt;STRONG&gt;[Size] - ((([Heads] * IF([SPD] &amp;gt;= $(vMaxSUSPD), $(vMaxSUSPD), [SPD])) / $(vSUR)) + ([Size] * $(vSOR))) &amp;gt;= 0, &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;//SET ANALYSIS - this needs fixing - i.e. replicate expression above - Show just the results where both the conditions above are true&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;[Size]={"&amp;gt;=$(=$(vMinSOS))"},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;[Size]={"&amp;gt;=&amp;nbsp; &lt;SPAN style="color: #ed111f;"&gt;&lt;STRONG&gt;#### What goes here? ####&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; "},&lt;/P&gt;&lt;P&gt;&amp;gt;}[Size])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open to recommendations on better ways of solving this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:51:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459156#M36035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-04T18:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Handling complexities - Arithmetic, Fields, Variables, Variables within variables, Greater than etc</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459157#M36036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would recommend to try something like this:&lt;/P&gt;&lt;P&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;=SUM({&amp;lt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;UniqueRowID&lt;/STRONG&gt;&lt;/SPAN&gt;={&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #339966;"&gt;"&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;=[Size] &amp;gt;= $(vMinSOS) AND &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;[Size] - ((([Heads] * IF([SPD] &amp;gt;= $(vMaxSUSPD), $(vMaxSUSPD), [SPD])) / $(vSUR)) + ([Size] * $(vSOR))) &amp;gt;= 0&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;}&amp;gt;} [Size] )&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #f70737;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;When doing a search like this it will pick rows from the underlying rowset. That is why you should have a field that is a unique row ID to pick the right rows to be used by the aggregation function. Maybe you already have one - if not create one in the load script. Even just a RowNo() will do as a row id in the right load statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 19:57:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459157#M36036</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-01-04T19:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Handling complexities - Arithmetic, Fields, Variables, Variables within variables, Greater than etc</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459158#M36037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is great and I do have a unique Id. When I tried what you suggested, SUM of rows that don't satisfy the condition are showing up as well with 0 for value. How can I suppress records with 0 values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 20:28:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459158#M36037</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-04T20:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Handling complexities - Arithmetic, Fields, Variables, Variables within variables, Greater than etc</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459159#M36038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to uncheck "Include Zero Values" in the properties of the chart in the section Add-ons / Data handling&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 21:59:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Handling-complexities-Arithmetic-Fields-Variables/m-p/1459159#M36038</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2018-01-04T21:59:23Z</dc:date>
    </item>
  </channel>
</rss>

