<?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: Problem with AvgCost expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815564#M66736</link>
    <description>&lt;P&gt;We’re missing something here. &amp;nbsp;I thought there is one value per month and it should be numeric. &amp;nbsp;Why are there multiple values for a month?&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 16:00:33 GMT</pubDate>
    <dc:creator>GaryGiles</dc:creator>
    <dc:date>2021-06-16T16:00:33Z</dc:date>
    <item>
      <title>Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815467#M66716</link>
      <description>&lt;P&gt;Good Afternoon All,&lt;/P&gt;&lt;P&gt;As we have a UK Mainland and an International team it's important that we work with the Transactional Currency in some instances. I'm trying to calculate the AvgCostAmount for our International team by using the expression:&amp;nbsp;Sum(AverageCostAmount)*ExchangeRate which works great when only selecting one month however when looking at a period greater than one month it only returns a hyphen.&lt;/P&gt;&lt;P&gt;We work to one budgeted Exchange Rate per month and my assumption is that Qlik isn't liking that there are multiple Exchange Rates when looking at larger periods. Is there an expression that I can use for Qlik to look at the Exchange Rate for each given month when calculating the AvgCostAmountTC?&lt;/P&gt;&lt;P&gt;All help is appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 11:24:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815467#M66716</guid>
      <dc:creator>Michael_Chappell</dc:creator>
      <dc:date>2021-06-16T11:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815498#M66722</link>
      <description>&lt;P&gt;I think you need to use the Aggr() function to first aggregate the values for each month.&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;sum(aggr(sum(AverageCostAmount)*ExchangeRate, [Month]))&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 12:47:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815498#M66722</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-06-16T12:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815503#M66725</link>
      <description>&lt;P&gt;Hi Gary,&lt;/P&gt;&lt;P&gt;Thank you for your reply. The above expressions works, however all values are coming back as '0.00'.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 13:02:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815503#M66725</guid>
      <dc:creator>Michael_Chappell</dc:creator>
      <dc:date>2021-06-16T13:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815511#M66726</link>
      <description>&lt;P&gt;&lt;SPAN&gt;And we are certain that there is only one ExchangeRate per [Month] and [Month] is the right field name?&amp;nbsp; We may want to add the Only() function to our ExchangeRate.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(aggr(sum(AverageCostAmount)*Only(ExchangeRate), [Month]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you create a table that has [Month] as the dimension and have 2 different measures, one: sum(AverageCostAmount), two: Only(ExchangeRate); what do the results look like?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 13:23:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815511#M66726</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-06-16T13:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815533#M66731</link>
      <description>&lt;P&gt;Hi Gary,&lt;/P&gt;&lt;P&gt;There&amp;nbsp; is definitely only one Exchange Rate per Month (or InvoiceMonth as the field is actually called. I modified your expression to reflect this).&lt;/P&gt;&lt;P&gt;Unfortunately adding the Only() function still results in zeros.&lt;/P&gt;&lt;P&gt;Creating said table, the ACA reacts as it should however the Only(ExchangeRate) results in '-' across all months.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 14:30:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815533#M66731</guid>
      <dc:creator>Michael_Chappell</dc:creator>
      <dc:date>2021-06-16T14:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815547#M66733</link>
      <description>&lt;P&gt;Try changing the Only(ExchangeRate) in the table to Concat(Distinct ExchangeRate,',').&amp;nbsp; What results do you get for each month?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 14:58:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815547#M66733</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-06-16T14:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815559#M66735</link>
      <description>&lt;P&gt;Each cell is now populated with a concatenation of the three Exchange Rates (Jan = ER1, ER2, ER3).&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 15:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815559#M66735</guid>
      <dc:creator>Michael_Chappell</dc:creator>
      <dc:date>2021-06-16T15:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815564#M66736</link>
      <description>&lt;P&gt;We’re missing something here. &amp;nbsp;I thought there is one value per month and it should be numeric. &amp;nbsp;Why are there multiple values for a month?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 16:00:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815564#M66736</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-06-16T16:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815738#M66752</link>
      <description>&lt;P&gt;The values are appearing as a numeric, I used ER1-3 as an example of how the data is appearing. My apologies for not specifying.&lt;/P&gt;&lt;P&gt;As for the multiples per month, we work in several currencies although there is only one budgeted exchange rate per currency i.e EURO will only have one value, USD will have a different single value for the month.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 10:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815738#M66752</guid>
      <dc:creator>Michael_Chappell</dc:creator>
      <dc:date>2021-06-17T10:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815765#M66755</link>
      <description>&lt;P&gt;Good information to have!!&amp;nbsp; Is the Currency field assoicated with the [Month] field?&amp;nbsp; We need to add the currency field to the expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(aggr(sum(AverageCostAmount)*Only(ExchangeRate), [Month],[Currency]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just curious, what results do you get by simply using the following expression?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(AverageCostAmount*ExchangeRate)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 11:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815765#M66755</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-06-17T11:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with AvgCost expression</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815788#M66759</link>
      <description>&lt;P&gt;Sorry Gary, I should've given that information from the get go!&lt;/P&gt;&lt;P&gt;Your first expression is still returning zeros unfortunately however I tried the bottom one and (you're not going to believe this Gary) but moving the bracket seems to have sorted the issue! I'm sure I tried that expression at the beginning when testing and it returned blanks but for whatever reason it's now working perfectly!&lt;/P&gt;&lt;P&gt;Thank you so much. You're a Qlik Genius!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 12:41:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-AvgCost-expression/m-p/1815788#M66759</guid>
      <dc:creator>Michael_Chappell</dc:creator>
      <dc:date>2021-06-17T12:41:41Z</dc:date>
    </item>
  </channel>
</rss>

