<?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 to avoid if's? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125325#M759430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Testing the UI (expressions) performance isn't very easy and without a systematically approach by evaluating the mem-files and/or looking within the document properties it's more a guessing than a monitoring. Nevertheless if there are not many objects so that the opening/calculating times might be added to noticable waiting-times the simpler approach of just using two objects/expressions and enabling either this one or the other will work to notice a significantly delaying or not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A premise for it is to exclude any caching of the objects/calculations. This means you need to close QlikView after each test and by the test you shouldn't do anything else within the app as directly opening the sheet / activating the object / selecting one or maye a few values. Otherwise the caching could impact the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case I doubt that the if-approach is faster than the variable-suggestion from &lt;A href="https://community.qlik.com/qlik-users/239588"&gt;meggesto&lt;/A&gt; because the condition is calculated ones and applied to all rows meanwhile the condition in the if-approach will be calculated multiple times (for each row) and also the branches of the if are calculated for each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I suggest to use such a variable-approach whereby you don't need mandatory to create a "normal" variable else using an adhoc-variable will often work, too. This means something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;RecOpenStatus = {'Open'}, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SequenceInd *= {"$(=IF(GetSelectedCount(SequenceInd)=0, 'Seq', '*'))"}&amp;gt;} DISTINCT ReceivableID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Aug 2018 08:01:49 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2018-08-28T08:01:49Z</dc:date>
    <item>
      <title>Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125314#M759419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have and expression like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(GetSelectedCount(SequenceInd)=0,&lt;/P&gt;&lt;P&gt; Count({$&amp;lt;RecOpenStatus = {'Open'}, SequenceInd = {'Seq'}&amp;gt;}DISTINCT ReceivableID),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count({$&amp;lt;RecOpenStatus = {'Open'}&amp;gt;}DISTINCT ReceivableID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think what I want to do is possible but I am hoping I am wrong and that I can increase performance. Is there another way to have my expression as Count({$&amp;lt;RecOpenStatus = {'Open'}, SequenceInd = {'Seq'}&amp;gt;}DISTINCT ReceivableID) but if another SequenceInd is selected, the result will reflect that? I am looking to reduce the IF statements in my application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125314#M759419</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125315#M759420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try this - &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Count({$&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SequenceInd = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;$(=GetSelectedCount(SequenceInd)=0)},RecOpenStatus = {'Open'}, SequenceInd = {'Seq'}&amp;gt;}DISTINCT ReceivableID),Count({$&amp;lt;RecOpenStatus = {'Open'}&amp;gt;}DISTINCT ReceivableID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:14:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125315#M759420</guid>
      <dc:creator>neelamsaroha157</dc:creator>
      <dc:date>2018-08-27T18:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125316#M759421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This returned null, althought I had to only use the part before the comma since using the entire thing is an invalid dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the first half, did you mean to put GetCurrentSelection instead of GetSelectedCount? I can almost see how that will work but I need it to default to 'Seq' still if possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125316#M759421</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-08-27T18:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125317#M759422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use a variable to control the possible value of SequenceInd in your set analysis.&lt;/P&gt;&lt;P&gt;You would want to first create a variable; something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSeq_Selected = IF(GetFieldSelections(SequenceInd) &amp;lt;&amp;gt; 'Seq', GetFieldSelections(SequenceInd), 'Seq)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in your set analysis you would replace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SequenceInd = {'Seq'} With SequenceInd = {'$(vSeq_Selected)'}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now If SequenceInd is not selected it will default to calculate it being Seq; if it is selected, it should calculate for the selected value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125317#M759422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-27T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125318#M759423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neelam, I think you are missing double quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SequenceInd = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;$("=GetSelectedCount(SequenceInd)=0")},RecOpenStatus = {'Open'}, SequenceInd = {'Seq'}&amp;gt;}DISTINCT ReceivableID),Count({$&amp;lt;RecOpenStatus = {'Open'}&amp;gt;}DISTINCT ReceivableID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:31:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125318#M759423</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2018-08-27T18:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125319#M759424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Thirumala for pointing that out. Appreciate it. Sometimes these little things gets missed out when you are directly writing expression without the actual qv file &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;H5 class="simple" style="padding-top: 8px; font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/H5&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:35:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125319#M759424</guid>
      <dc:creator>neelamsaroha157</dc:creator>
      <dc:date>2018-08-27T18:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125320#M759425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was thinking maybe something like this, but do you know if this would improve performance at all since there is still an IF statement? I had read that IF statements can hinder performance, which seems to be the case for me so I was looking for ways to eliminate them if possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125320#M759425</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-08-27T18:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125321#M759426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This still doesn't work. I don't think qlik will take two separate measures just separated by a comma or at least it doesnt work for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 18:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125321#M759426</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-08-27T18:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125322#M759427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I couldn't tell you without testing. If the IF Statement you reference is an Object Expression, then I could see this solution potentially saving time because of when it's calculated.&amp;nbsp; If that IF Statement is a variable just the same as the solution I propose; it may not be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 19:00:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125322#M759427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-27T19:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125323#M759428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was really hoping this would work so I was testing performance next to another object that had the IF statement, and if I changed the selection the object with the IF statement calculated about 2 seconds quicker than the one using the variable within the set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 19:45:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125323#M759428</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-08-27T19:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125324#M759429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have not tested but may be you can try below and see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Pick(GetSelectedCount(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SequenceInd), &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count({$&amp;lt;RecOpenStatus = {'Open'}, SequenceInd = {'Seq'}&amp;gt;}DISTINCT ReceivableID),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count({$&amp;lt;RecOpenStatus = {'Open'}&amp;gt;}DISTINCT ReceivableID))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 20:05:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125324#M759429</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-08-27T20:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis to avoid if's?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125325#M759430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Testing the UI (expressions) performance isn't very easy and without a systematically approach by evaluating the mem-files and/or looking within the document properties it's more a guessing than a monitoring. Nevertheless if there are not many objects so that the opening/calculating times might be added to noticable waiting-times the simpler approach of just using two objects/expressions and enabling either this one or the other will work to notice a significantly delaying or not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A premise for it is to exclude any caching of the objects/calculations. This means you need to close QlikView after each test and by the test you shouldn't do anything else within the app as directly opening the sheet / activating the object / selecting one or maye a few values. Otherwise the caching could impact the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case I doubt that the if-approach is faster than the variable-suggestion from &lt;A href="https://community.qlik.com/qlik-users/239588"&gt;meggesto&lt;/A&gt; because the condition is calculated ones and applied to all rows meanwhile the condition in the if-approach will be calculated multiple times (for each row) and also the branches of the if are calculated for each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I suggest to use such a variable-approach whereby you don't need mandatory to create a "normal" variable else using an adhoc-variable will often work, too. This means something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;RecOpenStatus = {'Open'}, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SequenceInd *= {"$(=IF(GetSelectedCount(SequenceInd)=0, 'Seq', '*'))"}&amp;gt;} DISTINCT ReceivableID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-to-avoid-if-s/m-p/125325#M759430</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-28T08:01:49Z</dc:date>
    </item>
  </channel>
</rss>

