<?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 Nested Setanalysis / Advanced aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-Setanalysis-Advanced-aggregation/m-p/363480#M493196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I again have a problem with setAnalysis, similar to &lt;A _jive_internal="true" href="https://community.qlik.com/message/218661#218661"&gt;this issue&lt;/A&gt;, and hope to get some help (and explanation) here…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have &lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Relations&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transactions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;I have a calculated dimension (to make sure relations are grouped per when the relation was last contacted (&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;YearMonthContactDate&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;%RelationNumber_key&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;What I want to do is to count the number of relations that have &lt;STRONG&gt;exactly &lt;/STRONG&gt;3 negative payments in the database (I need a column for “exactly 0 negative payments, exactly 1 negative, exactly 2 negative etc etc). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;My example is only about relations havingexactly 3 negative payments… But… Only those negative payments must be counted wherethe &lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Action TransactionDate] &lt;/SPAN&gt;lies after the first&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt; [ActionTransactionDate] &lt;/SPAN&gt;of this relation (for the selected&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt; %ActionCode&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my current expression. At first sight it seemed to work, but there is a bug in it and the clue lies in that "lies afther the first &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;[ActionTransactionDate] &lt;/SPAN&gt;" part...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: blue;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;if&lt;/SPAN&gt;(&lt;BR /&gt;&lt;SPAN style="color: blue;"&gt;aggr&lt;/SPAN&gt;(&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//count, PER %RelatieNummer_key the number of [Actionamount]&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;BR /&gt;{&lt;BR /&gt;$&amp;lt;&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//[Action amount] must be negative (For example -15) &lt;SPAN style="color: maroon;"&gt;[Actionamount]&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;lt;0"&lt;/SPAN&gt;}&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//the Date of this amount must lie AFTER the minimum[BoekingsDatum Actie] of this relation/%ActioncodeKey ,&lt;SPAN style="color: maroon;"&gt;[ActionTransactionDate]&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;gt;=$(=min({&amp;lt;[Actionamount]={'&amp;gt;0'},ActionSourcecode=p(%ActionCode_key)&amp;gt;}[ActionTransactionDate]) )"&lt;/SPAN&gt;},&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;// also take into account the negative values of ANYactionCode (as long as it is after the minimumdate) &lt;SPAN style="color: maroon;"&gt;%ActionCode_key&lt;/SPAN&gt;=&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;[Action amount]&lt;/SPAN&gt;&lt;BR /&gt;)&lt;BR /&gt;,&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;%RelationNumber_key&lt;/SPAN&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//EXACTLY 3 payments=3&lt;BR /&gt;,1,0)&lt;BR /&gt;)&lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I write it down in text it may be a bit difficult to follow. In the attached Qlikview I have attached a small project where the problem is visible. Additionally I added some screenshots and explanations that hopefully makes clear how it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated (as well as good references for further reading about making these kind of aggregations...)&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I tried to follow the logic of &lt;SPAN lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/218661#218661"&gt;this to&lt;/A&gt;pic &lt;/SPAN&gt; as well, because I think it is similar, but I didn't get the clue of that setAnalysis expression (yet). Any additional explanation is welcome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2012 15:08:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-22T15:08:06Z</dc:date>
    <item>
      <title>Nested Setanalysis / Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Setanalysis-Advanced-aggregation/m-p/363480#M493196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I again have a problem with setAnalysis, similar to &lt;A _jive_internal="true" href="https://community.qlik.com/message/218661#218661"&gt;this issue&lt;/A&gt;, and hope to get some help (and explanation) here…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have &lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Relations&lt;/P&gt;&lt;P&gt;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transactions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;I have a calculated dimension (to make sure relations are grouped per when the relation was last contacted (&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;YearMonthContactDate&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;%RelationNumber_key&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;What I want to do is to count the number of relations that have &lt;STRONG&gt;exactly &lt;/STRONG&gt;3 negative payments in the database (I need a column for “exactly 0 negative payments, exactly 1 negative, exactly 2 negative etc etc). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;My example is only about relations havingexactly 3 negative payments… But… Only those negative payments must be counted wherethe &lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[Action TransactionDate] &lt;/SPAN&gt;lies after the first&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt; [ActionTransactionDate] &lt;/SPAN&gt;of this relation (for the selected&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt; %ActionCode&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my current expression. At first sight it seemed to work, but there is a bug in it and the clue lies in that "lies afther the first &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;[ActionTransactionDate] &lt;/SPAN&gt;" part...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: blue;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: blue;"&gt;if&lt;/SPAN&gt;(&lt;BR /&gt;&lt;SPAN style="color: blue;"&gt;aggr&lt;/SPAN&gt;(&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//count, PER %RelatieNummer_key the number of [Actionamount]&lt;SPAN style="color: blue;"&gt;count&lt;/SPAN&gt;(&lt;BR /&gt;{&lt;BR /&gt;$&amp;lt;&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//[Action amount] must be negative (For example -15) &lt;SPAN style="color: maroon;"&gt;[Actionamount]&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;lt;0"&lt;/SPAN&gt;}&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//the Date of this amount must lie AFTER the minimum[BoekingsDatum Actie] of this relation/%ActioncodeKey ,&lt;SPAN style="color: maroon;"&gt;[ActionTransactionDate]&lt;/SPAN&gt;={&lt;SPAN style="color: maroon;"&gt;"&amp;gt;=$(=min({&amp;lt;[Actionamount]={'&amp;gt;0'},ActionSourcecode=p(%ActionCode_key)&amp;gt;}[ActionTransactionDate]) )"&lt;/SPAN&gt;},&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;// also take into account the negative values of ANYactionCode (as long as it is after the minimumdate) &lt;SPAN style="color: maroon;"&gt;%ActionCode_key&lt;/SPAN&gt;=&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;[Action amount]&lt;/SPAN&gt;&lt;BR /&gt;)&lt;BR /&gt;,&lt;BR /&gt;&lt;SPAN style="color: maroon;"&gt;%RelationNumber_key&lt;/SPAN&gt;&lt;BR /&gt;)&lt;BR /&gt;&lt;SPAN style="color: green;"&gt;//EXACTLY 3 payments=3&lt;BR /&gt;,1,0)&lt;BR /&gt;)&lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I write it down in text it may be a bit difficult to follow. In the attached Qlikview I have attached a small project where the problem is visible. Additionally I added some screenshots and explanations that hopefully makes clear how it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated (as well as good references for further reading about making these kind of aggregations...)&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I tried to follow the logic of &lt;SPAN lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/218661#218661"&gt;this to&lt;/A&gt;pic &lt;/SPAN&gt; as well, because I think it is similar, but I didn't get the clue of that setAnalysis expression (yet). Any additional explanation is welcome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 15:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Setanalysis-Advanced-aggregation/m-p/363480#M493196</guid>
      <dc:creator />
      <dc:date>2012-05-22T15:08:06Z</dc:date>
    </item>
    <item>
      <title>Nested Setanalysis / Advanced aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-Setanalysis-Advanced-aggregation/m-p/363481#M493197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since there are no replies yet, and this problem is quite urgent for my customer, another message from my side. I'd really like additional info that may help me solve this issue (in whatever way)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current way of trying (and I think it should work!) is use Set Analysis. Especially my problem is how I can make sure Qlikview does not take the minimum date of the _entire selection_ but the minimum date that exists inside my dimension...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All clues ideas etc are more than welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 12:21:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-Setanalysis-Advanced-aggregation/m-p/363481#M493197</guid>
      <dc:creator />
      <dc:date>2012-05-24T12:21:40Z</dc:date>
    </item>
  </channel>
</rss>

