<?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: Include dynamic calculation on a Set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Include-dynamic-calculation-on-a-Set-analysis/m-p/1860939#M71043</link>
    <description>&lt;P&gt;What you are trying couldn't be done with a classical set analyses which worked mainly like a selection. There may be ways to write such condition within a set analysis but it would be executed like an if-loop. Therefore it's syntactically and logically easier not to match both approaches else to combine them separately. I think I would tend to something like this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;DateStart={"&amp;lt;=[RangeDateFinish]"}, DateFinish={"&amp;gt;=[RangeDateStart]"}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;} distinct Client) *&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;-(count(DateAnalysis)=1)&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Depending on your requirements you may need to apply the date-conditions to the second-part, too.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 11:45:18 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2021-11-18T11:45:18Z</dc:date>
    <item>
      <title>Include dynamic calculation on a Set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Include-dynamic-calculation-on-a-Set-analysis/m-p/1860537#M71007</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I've got a problem to resolve that seem quite insoluble for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I work with data formated like that in my model :&lt;/P&gt;
&lt;TABLE border="1" width="64%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="10%" height="25px"&gt;&lt;EM&gt;Line&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;Client&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;DateStart&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;DateFinish&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;DateAnalysis&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%" height="25px"&gt;&lt;EM&gt;1&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01/01/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;31/01/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;-&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%" height="25px"&gt;&lt;EM&gt;2&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01/02/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;15/02/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;15/02/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%" height="25px"&gt;&lt;EM&gt;3&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;16/02/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;31/03/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;31/03/2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%" height="25px"&gt;&lt;EM&gt;4&lt;/EM&gt;&lt;/TD&gt;
&lt;TD width="10%" height="25px"&gt;B&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;01/01/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;31/01/2021&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;-&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Easy level&lt;/U&gt; :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I need to count clients on a date or on a range date.&lt;/P&gt;
&lt;P&gt;For a Single Date, I used a syntax in order to keep only 1 line per client =&amp;gt; The line containing the [SelectDate].&lt;BR /&gt;Count({&amp;lt;DateStart={"&amp;lt;=[SelectDate]"}, DateFinish={"&amp;gt;=[SelectDate]"}&amp;gt;} distinct Client)&lt;/P&gt;
&lt;P&gt;Example for the 10/01/2021, I will keep the line 1 and 4.&lt;/P&gt;
&lt;P&gt;For a Range Date, I keep all line containing a date in the [RangeDate].&lt;BR /&gt;Count({&amp;lt;DateStart={"&amp;lt;=[RangeDateFinish]"}, DateFinish={"&amp;gt;=[RangeDateStart]"}&amp;gt;} distinct Client)&lt;/P&gt;
&lt;P&gt;Example for the 10/01/2021 to 10/02/2021, I will keep the line 1, 2 and 4.&lt;/P&gt;
&lt;P&gt;This works fine.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Hard level&lt;/U&gt; :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Same start (I need to count clients on a range date) if there's only 1 distinct DateAnalysis per client in the [RangeDate].&lt;BR /&gt;(For example I will have another analysis&amp;nbsp;if there's 2 distinct DateAnalysis per client in the [RangeDate])&lt;/P&gt;
&lt;P&gt;Example for the 10/01/2021 to 31/01/2021, result will be 0 (Work on line 1&amp;nbsp; and 4, no DateAnalysis).&lt;/P&gt;
&lt;P&gt;Example for the 10/01/2021 to 10/02/2021, result will be 1 (Work on line 1, 2 and 4, Client A have 1 DateAnalysis, B have 0 DateAnalysis).&lt;/P&gt;
&lt;P&gt;My problem is to add this dynamic calculation per client criteria.&amp;nbsp;&lt;BR /&gt;I can't do something like :&lt;BR /&gt;Count({&amp;lt;DateStart={"&amp;lt;=[RangeDateFinish]"}, DateFinish={"&amp;gt;=[RangeDateStart]"}, &lt;FONT color="#FF0000"&gt;count(DateAnalysis)={1}&lt;/FONT&gt;&amp;gt;} distinct Client)&lt;/P&gt;
&lt;P&gt;I think it's impossible but I can't find "how" or "how change my data" do this.&lt;/P&gt;
&lt;P&gt;I will take any help and be very thankfull ! Don't hesitate to ask me for more information. It's not very clear.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 15:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Include-dynamic-calculation-on-a-Set-analysis/m-p/1860537#M71007</guid>
      <dc:creator>_CD_</dc:creator>
      <dc:date>2021-11-17T15:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Include dynamic calculation on a Set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Include-dynamic-calculation-on-a-Set-analysis/m-p/1860939#M71043</link>
      <description>&lt;P&gt;What you are trying couldn't be done with a classical set analyses which worked mainly like a selection. There may be ways to write such condition within a set analysis but it would be executed like an if-loop. Therefore it's syntactically and logically easier not to match both approaches else to combine them separately. I think I would tend to something like this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;DateStart={"&amp;lt;=[RangeDateFinish]"}, DateFinish={"&amp;gt;=[RangeDateStart]"}&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;} distinct Client) *&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;-(count(DateAnalysis)=1)&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Depending on your requirements you may need to apply the date-conditions to the second-part, too.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 11:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Include-dynamic-calculation-on-a-Set-analysis/m-p/1860939#M71043</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-11-18T11:45:18Z</dc:date>
    </item>
  </channel>
</rss>

