<?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: Conversion from if statement to pick and match function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2003377#M83080</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 07:12:56 GMT</pubDate>
    <dc:creator>Aryasmank</dc:creator>
    <dc:date>2022-11-11T07:12:56Z</dc:date>
    <item>
      <title>Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2001767#M82980</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to change the if statement to the pick and match function, but there is "greater than" in if statement. I'm unable to find out how to do that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my expression :&lt;/P&gt;
&lt;P&gt;if([Date] = Date($(MaxDate)), $(tostate),&lt;BR /&gt;if([Date] &amp;gt; Date($(MaxDate)),&lt;BR /&gt;if(linest_m( total aggr(if(count(id_CR) ,count(id_CR)),[Date] ),[Date] ) &amp;gt;=0,&lt;BR /&gt;&lt;BR /&gt;$(tostate)- RangeSum( Above(linest_m( total aggr(if(count(id_CR) ,count(id_CR)),[Date] ),[Date] )&lt;BR /&gt;*[Date.FiscYear.YearMonth]&lt;BR /&gt;+linest_b( total aggr(if(count(id_CR) ,count( id_CR)),[Date] ),[Date] )&lt;BR /&gt;,0,(((year([Date] )*12)+month([Date] ))-((year(Date($(MaxDate)))*12)+month(Date($(MaxDate)))))&lt;BR /&gt;))&lt;/P&gt;
&lt;P&gt;,&lt;BR /&gt;$(tostate)- RangeSum(above($(laststate)&lt;BR /&gt;,0,(((year([Date] )*12)+month([Date] ))-((year(Date($(MaxDate)))*12)+month(Date($(MaxDate)))))&lt;BR /&gt;))&lt;BR /&gt;&lt;BR /&gt;)))&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aryasmank_0-1667916402968.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/93100i9588E5BDD1F4B59C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aryasmank_0-1667916402968.png" alt="Aryasmank_0-1667916402968.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone has any inputs please share.&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;M&lt;/P&gt;
&lt;P&gt;#if-else&amp;nbsp; #pick-match&amp;nbsp; #optimization&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 14:09:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2001767#M82980</guid>
      <dc:creator>Aryasmank</dc:creator>
      <dc:date>2022-11-08T14:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2001783#M82982</link>
      <description>&lt;P&gt;To code your Match using varying expressions, use "-1" (true) as first argument and code it like this:&lt;/P&gt;
&lt;P&gt;Match(-1,&amp;nbsp;&lt;SPAN&gt;[Date] = Date($(MaxDate),&amp;nbsp;[Date] &amp;gt; Date($(MaxDate), etc...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Why are you converting from If() to Pick(Match())? if it's for optimization my experience is that pick(match()) performs the same as if().&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Rob&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 14:38:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2001783#M82982</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2022-11-08T14:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2002130#M83007</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;Thanks for the response,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I'm converting it for optimization , as you said ,&amp;nbsp;&lt;SPAN&gt;pick(match()) performs the same as if(), can you please suggest any other option for&amp;nbsp;optimising the above&amp;nbsp;expression . It will really&amp;nbsp;&lt;/SPAN&gt;helpful.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Mayank&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 06:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2002130#M83007</guid>
      <dc:creator>Aryasmank</dc:creator>
      <dc:date>2022-11-09T06:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2002282#M83021</link>
      <description>&lt;P&gt;I do agree with Rob that there won't be a significantly performance difference between if() and pick(match()). But you may optimize your calculations itself. For example, the part of:&amp;nbsp;&lt;SPAN&gt;if(count(id_CR) ,count(id_CR)) might be just replaced with&amp;nbsp;count(id_CR). &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, the continuous period-counter of&amp;nbsp;(year([Date]*12+month([Date])) could be already generated within the script and the period-counter to the variable outsourced within another variable and maybe even also created within the script (if the max-date is always a quite fixed value like today() or similar).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Whereby I wouldn't expect a much better performance from these measures&amp;nbsp;because the general approach is quite resource expensive - nested if-loops with aggr() within interrecord-functions won't be never really fast. Therefore you may need a re-design of your object/view and/or the underlying data-model.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 10:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2002282#M83021</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-09T10:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2002783#M83046</link>
      <description>&lt;P&gt;Hi, thanks for the input ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if possible, can you please explain, little more , the second para about &lt;STRONG&gt;continuous period-counter&lt;/STRONG&gt;&amp;nbsp;. It will really helpful.&lt;/P&gt;
&lt;P&gt;Note: the&amp;nbsp;&lt;SPAN&gt;MaxDate is also contain the nested if expression&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thanks ,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Mayank&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 06:10:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2002783#M83046</guid>
      <dc:creator>Aryasmank</dc:creator>
      <dc:date>2022-11-10T06:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2003216#M83066</link>
      <description>&lt;P&gt;Something like:&amp;nbsp;&lt;SPAN&gt;year([Date]*12+month([Date]) could be added within a master-calendar and would then be available for all calculations.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Marcus&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 17:11:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2003216#M83066</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-11-10T17:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from if statement to pick and match function</title>
      <link>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2003377#M83080</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 07:12:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conversion-from-if-statement-to-pick-and-match-function/m-p/2003377#M83080</guid>
      <dc:creator>Aryasmank</dc:creator>
      <dc:date>2022-11-11T07:12:56Z</dc:date>
    </item>
  </channel>
</rss>

