<?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: Calculated Dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583817#M42683</link>
    <description>&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;but doh! - just add 'Australia' to the end of the IF statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I've got my dimensions but the Australia values are all wrong though Russia &amp;amp; Germany are ok?&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;RecType={2}, CountryFlag={1}, Country=p(Country)+{'Australia'}, UoM={'MT'}, CalYear&amp;gt;} Quantity)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 09:46:13 GMT</pubDate>
    <dc:creator>gthomson4</dc:creator>
    <dc:date>2019-05-23T09:46:13Z</dc:date>
    <item>
      <title>Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583748#M42676</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to create a chart that has -&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Top 50% of countries&lt;/LI&gt;&lt;LI&gt;+ Australia&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The following works when there is no selection&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr( DISTINCT
  	If( RangeSum( Above(Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), 1, RowNo() ))
               	      / Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} TOTAL Quantity) &amp;lt; 0.5
	OR Country='Australia'
      ,Country )
//    sorted structure parameter
      ,(Country,(=Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity),Desc))
    )&lt;/LI-CODE&gt;&lt;P&gt;but when I select 'Europe' I only get Russia &amp;amp; Germany which is correct for the 50% part, but can't add Australia. (i.e. I want Australia regardless of where it comes in the rankings) I tried using a reference line but that didn't work either.&lt;/P&gt;&lt;P&gt;Any ideas would be appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:45:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583748#M42676</guid>
      <dc:creator>gthomson4</dc:creator>
      <dc:date>2024-11-16T05:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583803#M42680</link>
      <description>&lt;P&gt;Maybe this is helpful:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;=Aggr( DISTINCT&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( RangeSum( Above(Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), 1, RowNo() ))&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/ Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} TOTAL Quantity) &amp;lt; 0.5&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR Country='Australia'&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;only({&amp;lt;&lt;/FONT&gt; Country&amp;nbsp; = &amp;gt;} Country)&lt;/STRONG&gt; )&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; sorted structure parameter&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,(Country,(=Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity),Desc))&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 09:22:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583803#M42680</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-23T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583817#M42683</link>
      <description>&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;but doh! - just add 'Australia' to the end of the IF statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I've got my dimensions but the Australia values are all wrong though Russia &amp;amp; Germany are ok?&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;RecType={2}, CountryFlag={1}, Country=p(Country)+{'Australia'}, UoM={'MT'}, CalYear&amp;gt;} Quantity)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 09:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583817#M42683</guid>
      <dc:creator>gthomson4</dc:creator>
      <dc:date>2019-05-23T09:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583824#M42684</link>
      <description>sorry, that's my 'doh!' moment &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 23 May 2019 09:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1583824#M42684</guid>
      <dc:creator>gthomson4</dc:creator>
      <dc:date>2019-05-23T09:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1584408#M42737</link>
      <description>&lt;P&gt;ok, I've made progress on this but still have a small issue.&lt;/P&gt;&lt;P&gt;To get the top 50% &lt;U&gt;and&lt;/U&gt; Australia I used this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr( DISTINCT
  	If( RangeSum( Above(Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), 1, RowNo() ))
               	      / Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} TOTAL Quantity) &amp;lt; 0.5
      ,(Country) ) 
//    sorted structure parameter
      ,(Country,(=Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity),Desc))
    )
&amp;amp;Aggr( Only({1&amp;lt;Country={'Australia'}&amp;gt;} (Country) ), Country)&lt;/LI-CODE&gt;&lt;P&gt;Basically appending another aggregation result where 'Only' returns just Australia&amp;nbsp;(thanks Marcus)&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works except that when I filter on 'Oceania' I get a dimension labelled "AustraliaAustralia" though the figures are correct. i.e. it is being selected in both Aggr() 1 &amp;amp; 2.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/12616i0275C5D2816FDF84/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I thought I could use {1-$} in the set analysis to exclude Australia from the 2nd part if it was already in the 1st part, however this results in every country in the region being listed, not Australia, and "RussiaRussia" &amp;amp; "GermanyGermany" dimensions. It's as though it is doing the exact opposite of what it should!?&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&amp;amp;Aggr( Only({1-$&amp;lt;Country={'Australia'}&amp;gt;} (Country) ), Country)&lt;/P&gt;&lt;P&gt;Any ideas would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 10:07:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1584408#M42737</guid>
      <dc:creator>gthomson4</dc:creator>
      <dc:date>2019-05-24T10:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1584455#M42739</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=If(
Aggr(RangeSum(Above(Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), 1, RowNo()))/Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} TOTAL Quantity), (Country,(=Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), Desc))) &amp;lt; 0.5
  or
Country = 'Australia',
Country)&lt;/LI-CODE&gt;&lt;P&gt;and this set analysis in your expression&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{&amp;lt;Country += {'Austrlia'}&amp;gt;}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 May 2019 11:52:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1584455#M42739</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-05-24T11:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1585462#M42821</link>
      <description>&lt;P&gt;Thanks Sunny, however the Aggr() seems to ignore Set Analysis. The following doesn't pick up Australia:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr({1&amp;lt;Country += {'Australia'}&amp;gt;} DISTINCT
  	If( RangeSum( Above(Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), 1, RowNo() ))
               	      / Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} TOTAL Quantity) &amp;lt; 0.5
	Or Country='Australia'
     ,Country  )	
//    sorted structure parameter
      ,(Country,(=Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity),Desc))
    )
//&amp;amp;Aggr( Only({1&amp;lt;Country={'Australia'}&amp;gt;} (Country) ), Country)&lt;/LI-CODE&gt;&lt;P&gt;I also tried using Only() as the condition but no difference. (and various other combinations)&lt;/P&gt;&lt;P&gt;It almost works when I append the (commented)&amp;nbsp; Aggr() using Only() but I get 'AustraliaAustralia' when selecting 'Oceana', i.e. it picks it up in both.&lt;/P&gt;&lt;P&gt;Interestingly, when I use {1-$&amp;lt; in the 2nd Aggr() I get all the remaining countries of the 1st Aggr() but not 'Australia'. It is as though it is doing the exact opposite of what I expect which is the 2nd Aggr should include everything not in the 1st?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 09:19:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1585462#M42821</guid>
      <dc:creator>gthomson4</dc:creator>
      <dc:date>2019-05-28T09:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1588796#M43146</link>
      <description>&lt;P&gt;I have a solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr( DISTINCT
//	get the top 50% of countries in the current selection     
  	If( (RangeSum( Above(Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity), 1, RowNo() ))
               	       / Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} TOTAL Quantity)			) &amp;lt; 0.5
      ,Country ) 
//    sorted structure parameter
      ,(Country,(=Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}&amp;gt;} Quantity),Desc))
    )
//	append Australia if it isn't part of the current selection
&amp;amp;Aggr ( DISTINCT 
	If(GetSelectedCount(UNContinentalRegion) or GetSelectedCount(UNSatisticalRegion)
      ,Only({1&amp;lt;Country={'Australia'},UNContinentalRegion=,UNSatisticalRegion=&amp;gt;-$&amp;lt;Country=P(Country)&amp;gt;} Country)
      ,Only({$&amp;lt;Country={'Australia'} &amp;gt;} Country)    )
    , Country )
 
/*&lt;/LI-CODE&gt;&lt;P&gt;It now works unless Australia is part of the 1st selection but not in the top 50%, e.g. Asia + Oceania. I avoid duplicating Australia by excluding the 1st selection from the 2nd. Where there is no selection of Region or Sub-region then it just adds Australia.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to match the set analysis in the measure like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum({$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}, CalYear&amp;gt;
	+$&amp;lt;RecType={2}, CountryFlag={1}, UoM={'MT'}, CalYear, Country={'Australia'},UNContinentalRegion=,UNSatisticalRegion=&amp;gt;}
	Quantity
    )

/*&lt;/LI-CODE&gt;&lt;P&gt;So, this is the required set + specifically Australia disregarding Region &amp;amp; Sub-region. I used a union in this way to avoid including other countries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't imagine this is optimal but it works. Thanks for you suggestions.&lt;/P&gt;&lt;P&gt;(And yes 'Statistical' is miss-spelt)&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 01:59:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-Dimension/m-p/1588796#M43146</guid>
      <dc:creator>gthomson4</dc:creator>
      <dc:date>2019-06-06T01:59:06Z</dc:date>
    </item>
  </channel>
</rss>

