<?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 aggr with multiple dimensions  with complex set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/aggr-with-multiple-dimensions-with-complex-set-analysis/m-p/1567088#M41352</link>
    <description>&lt;P&gt;hi everyone!, this is my first post!&amp;nbsp;&lt;IMG id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://community.qlik.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i´ve been developing an app en Qlik Sense which is very ambitious.&lt;/P&gt;&lt;P&gt;the problem is the following:&lt;/P&gt;&lt;P&gt;I have a QVD with all the daily prices of diferent funds and wanted to show a table with the returns of the diferent products&lt;/P&gt;&lt;P&gt;there is a 3 level hierarchy which is:&lt;/P&gt;&lt;P&gt;Company =&amp;gt; Fund =&amp;gt; Class&lt;/P&gt;&lt;P&gt;and i wanted to have a table that showed the returns of the selecction in every hierarchy level.&lt;/P&gt;&lt;P&gt;the formula i´ve wrote was:&lt;/P&gt;&lt;PRE&gt;if(count(distinct ID)=1,
(
sum({&amp;lt;Date= {"$(vMaxDate)"}&amp;gt;}Price)/
sum({&amp;lt;Date= {"$(v_YTD)"}&amp;gt;}Price)
-1)
,
sum(aggr(

sum({&amp;lt;Date= {"$(vMaxDate)"}&amp;gt;}Price*AUM)/
sum({&amp;lt;Date= {"$(v_YTD)"}&amp;gt;}Price)

,ID))
/sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}AUM)

-1

)&lt;/PRE&gt;&lt;P&gt;which works fine for the last level of the hierarchy, but for level 1 and 2 theres the following situation where the result is not as expected.&lt;/P&gt;&lt;P&gt;if im calculating the return of a fund from 12/31/2018 to 03/31/2018 but the fund has 2 starting series and 4 ending series.&lt;/P&gt;&lt;P&gt;i see two posibilites. the first one is try to use the price at the first day of each series that started after 12/31/2018 or to just use the 2 series that existed by 12/31/2018.&amp;nbsp;&lt;/P&gt;&lt;P&gt;also, the solution has to be by formula and not by script because there are several columns with diferent periods for the calculation.&lt;/P&gt;&lt;P&gt;but the i have not been able to write the formula. any help will be greatly aprreciated&lt;/P&gt;&lt;P&gt;heres is what i have been trying:&lt;/P&gt;&lt;PRE&gt;if(count(distinct ID)=1,
(
sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}Price)/
sum({&amp;lt;Date = {"$(v_YTD)"}&amp;gt;}Price)
-1)
,
sum(aggr(

sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}Price*AUM)/
sum({&amp;lt;Date = {"$(=rangemax((num(YearEnd(max(ALL Date),-1))-1),min( TOTAL &amp;lt;ID&amp;gt; Date)))"}&amp;gt;}Price)*
,ID, Date))
/sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}AUM)
-1

)&lt;/PRE&gt;&lt;P&gt;here are some pictures:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Level 2" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9804i22BDAA302E764DA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Level 2.PNG" alt="Level 2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Level 2&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Level 3" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9805iCB99A4E3B0965FB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Level 3.PNG" alt="Level 3" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Level 3&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;hope i´ve explained well. thanks for any help or guidance on how to aproach this problem!!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 06:06:51 GMT</pubDate>
    <dc:creator>Alfovic</dc:creator>
    <dc:date>2024-11-16T06:06:51Z</dc:date>
    <item>
      <title>aggr with multiple dimensions  with complex set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/aggr-with-multiple-dimensions-with-complex-set-analysis/m-p/1567088#M41352</link>
      <description>&lt;P&gt;hi everyone!, this is my first post!&amp;nbsp;&lt;IMG id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://community.qlik.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i´ve been developing an app en Qlik Sense which is very ambitious.&lt;/P&gt;&lt;P&gt;the problem is the following:&lt;/P&gt;&lt;P&gt;I have a QVD with all the daily prices of diferent funds and wanted to show a table with the returns of the diferent products&lt;/P&gt;&lt;P&gt;there is a 3 level hierarchy which is:&lt;/P&gt;&lt;P&gt;Company =&amp;gt; Fund =&amp;gt; Class&lt;/P&gt;&lt;P&gt;and i wanted to have a table that showed the returns of the selecction in every hierarchy level.&lt;/P&gt;&lt;P&gt;the formula i´ve wrote was:&lt;/P&gt;&lt;PRE&gt;if(count(distinct ID)=1,
(
sum({&amp;lt;Date= {"$(vMaxDate)"}&amp;gt;}Price)/
sum({&amp;lt;Date= {"$(v_YTD)"}&amp;gt;}Price)
-1)
,
sum(aggr(

sum({&amp;lt;Date= {"$(vMaxDate)"}&amp;gt;}Price*AUM)/
sum({&amp;lt;Date= {"$(v_YTD)"}&amp;gt;}Price)

,ID))
/sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}AUM)

-1

)&lt;/PRE&gt;&lt;P&gt;which works fine for the last level of the hierarchy, but for level 1 and 2 theres the following situation where the result is not as expected.&lt;/P&gt;&lt;P&gt;if im calculating the return of a fund from 12/31/2018 to 03/31/2018 but the fund has 2 starting series and 4 ending series.&lt;/P&gt;&lt;P&gt;i see two posibilites. the first one is try to use the price at the first day of each series that started after 12/31/2018 or to just use the 2 series that existed by 12/31/2018.&amp;nbsp;&lt;/P&gt;&lt;P&gt;also, the solution has to be by formula and not by script because there are several columns with diferent periods for the calculation.&lt;/P&gt;&lt;P&gt;but the i have not been able to write the formula. any help will be greatly aprreciated&lt;/P&gt;&lt;P&gt;heres is what i have been trying:&lt;/P&gt;&lt;PRE&gt;if(count(distinct ID)=1,
(
sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}Price)/
sum({&amp;lt;Date = {"$(v_YTD)"}&amp;gt;}Price)
-1)
,
sum(aggr(

sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}Price*AUM)/
sum({&amp;lt;Date = {"$(=rangemax((num(YearEnd(max(ALL Date),-1))-1),min( TOTAL &amp;lt;ID&amp;gt; Date)))"}&amp;gt;}Price)*
,ID, Date))
/sum({&amp;lt;Date = {"$(vMaxDate)"}&amp;gt;}AUM)
-1

)&lt;/PRE&gt;&lt;P&gt;here are some pictures:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Level 2" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9804i22BDAA302E764DA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Level 2.PNG" alt="Level 2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Level 2&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Level 3" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9805iCB99A4E3B0965FB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Level 3.PNG" alt="Level 3" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Level 3&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;hope i´ve explained well. thanks for any help or guidance on how to aproach this problem!!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:06:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/aggr-with-multiple-dimensions-with-complex-set-analysis/m-p/1567088#M41352</guid>
      <dc:creator>Alfovic</dc:creator>
      <dc:date>2024-11-16T06:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: aggr with multiple dimensions  with complex set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/aggr-with-multiple-dimensions-with-complex-set-analysis/m-p/1568309#M41460</link>
      <description>&lt;P&gt;i´ve realized that calculating the based on the available date would not be right for comparing. so that leave me woth filtering by the clases that have all the time series.&lt;/P&gt;&lt;P&gt;is there a way to have something like:&lt;/P&gt;&lt;PRE&gt;sum({&amp;lt;Date= {"$(vMaxDate)"}&amp;gt;}Price*if(sum({&amp;lt;Date= {"$(v_YTD)"}&amp;gt;}Price)=0,0,1))&lt;/PRE&gt;&lt;P&gt;so that it only consider the price when theres a value for the first date?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 15:54:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/aggr-with-multiple-dimensions-with-complex-set-analysis/m-p/1568309#M41460</guid>
      <dc:creator>Alfovic</dc:creator>
      <dc:date>2019-04-11T15:54:23Z</dc:date>
    </item>
  </channel>
</rss>

