<?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: Dual set-analyses loses dimension in piviot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521080#M554029</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using a dollar sign expansion with an expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(=Min(Arrival)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then this will be evaluated first, in global context, not considering any dimensions of your chart (it's like a macro expansion, it will be evaluated before anything else get's done).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also your set expression is only evaluated once per chart, not considering your dimension&lt;/P&gt;&lt;P&gt;(see this document for &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-1335"&gt;more &lt;/A&gt;details).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So set analysis alone will not work here, and you probably need to use some other technique, like advanced aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it would be good if you could post some more details, best by posting a small sample app that demonstrate your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Aug 2013 20:54:36 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-08-22T20:54:36Z</dc:date>
    <item>
      <title>Dual set-analyses loses dimension in piviot table</title>
      <link>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521079#M554026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi all! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have a piviot table with a dimension "ID" and a set-analyses as expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;DateTime&lt;/SPAN&gt;-={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;$(=Min({&amp;lt;Station_ID={44}&amp;gt;}Arrival,2))"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;}&amp;gt;}DateTime) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The set expression is doing the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;1. Picking the secound eariest date of Arrival when Station_ID is 44 &lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #575757; text-decoration: underline;"&gt;for the ID in the dimension&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;2. Excluding all dates for the given ID in DateTime which is after this date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;3. Counting how many rows there are left in DateTime&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The set-analyses gives out 0 for all ID's. &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 249px; HEIGHT: 62px; BORDER-TOP: #000000 1px solid; BORDER-RIGHT: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG style=": ; font-size: 8pt;"&gt;Set analyses&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;32-338&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;32-339&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;32-340&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;32-341&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;But w&lt;SPAN style="font-size: 10pt;"&gt;hen I select a ID it gives out the right answear &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 100%; BORDER-TOP: #000000 1px solid; BORDER-RIGHT: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Set analyses&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;32-339&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;320&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;It seams that the secound set-analyses &amp;gt;$(=Min({&amp;lt;Station_ID={44}&amp;gt;}Arrival,2)) cant read the ID for the actual row.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Is it any way to call for the value in the ID column? Something l&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;ike: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;DateTime&lt;/SPAN&gt;-={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;$(=Min({&amp;lt;Station_ID={44}, ID={get value from first column}&amp;gt;}Arrival,2))"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;}&amp;gt;}DateTime) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Or is it possible to solve it in anouther way? I have tried to use aggr but it gives out the same answear.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;-={&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;"&amp;gt;$(=(aggr(Min({&amp;lt;Station_ID={44}&amp;gt;}Arrival,2),ID)))"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;}&amp;gt;}DateTime) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 20:24:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521079#M554026</guid>
      <dc:creator />
      <dc:date>2013-08-22T20:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dual set-analyses loses dimension in piviot table</title>
      <link>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521080#M554029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using a dollar sign expansion with an expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(=Min(Arrival)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then this will be evaluated first, in global context, not considering any dimensions of your chart (it's like a macro expansion, it will be evaluated before anything else get's done).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also your set expression is only evaluated once per chart, not considering your dimension&lt;/P&gt;&lt;P&gt;(see this document for &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-1335"&gt;more &lt;/A&gt;details).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So set analysis alone will not work here, and you probably need to use some other technique, like advanced aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it would be good if you could post some more details, best by posting a small sample app that demonstrate your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 20:54:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521080#M554029</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-08-22T20:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Dual set-analyses loses dimension in piviot table</title>
      <link>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521081#M554030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for youre reply @swuehl!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right that Set-analysis would not work for dual set-analyses, however I have found that it does work for a single set-analyses. When i only use one the expression it will consider my dimension. (see column 2 in Test table in attached file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I cant use dual set analyses for this purpose, could you please elaborate a bit on what you mean by advanced aggregation?&lt;/P&gt;&lt;P&gt;Do you mean aggregating it in the load script?&lt;/P&gt;&lt;P&gt;I have no experience of that, could you give me an example to lead me in the right direction? or eaven better write it in the qv-file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for taking time for my issue!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:09:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dual-set-analyses-loses-dimension-in-piviot-table/m-p/521081#M554030</guid>
      <dc:creator />
      <dc:date>2013-08-27T07:09:09Z</dc:date>
    </item>
  </channel>
</rss>

