<?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: Order Value per Region in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2003378#M83081</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/157017"&gt;@Yrstruly2021&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not downloaded your data, but I am sure based schema you should be able to get to your required answer trying the following. &lt;BR /&gt;Create a month field in your script, as suggested by Edgar.&lt;BR /&gt;I would do it this way, "Date(MonthStart(ORDERDATE), 'MMM yyyy') as yearmonth".&lt;/P&gt;
&lt;P&gt;On your selected chart, add the yearmonth field as dimension and create a measure for your average order value.&lt;BR /&gt;"sum ( {$&amp;lt;Region={Africa}&amp;gt;} OrderPrice) / Count(&amp;nbsp;{$&amp;lt;Region={Africa}&amp;gt;}&amp;nbsp; distinct orderkey)"&lt;/P&gt;</description>
    <pubDate>Fri, 11 Nov 2022 07:14:43 GMT</pubDate>
    <dc:creator>williejacobs</dc:creator>
    <dc:date>2022-11-11T07:14:43Z</dc:date>
    <item>
      <title>Order Value per Region</title>
      <link>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2000150#M82837</link>
      <description>&lt;P&gt;Please assist. I want to answer this question:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"What is the average order value in the African Region per month?"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;My Data Model:&lt;/P&gt;
&lt;DIV id="tinyMceEditorYrstruly2021_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SELECT Avg(Orders)&amp;nbsp; AS Order Value&lt;/P&gt;
&lt;P&gt;FROM Orders, Customer, Nation, Region&lt;/P&gt;
&lt;P&gt;Join Customer AS C&lt;/P&gt;
&lt;P&gt;ON Customer.Custkey = Orders.Custkey&lt;/P&gt;
&lt;P&gt;Join Customer AS C ON Customer.Nationkey=Nation.Nationkey&lt;/P&gt;
&lt;P&gt;Join Nation.Nationkey=Region.Nationkey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where Region = Africa&lt;/P&gt;
&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1RxutoJHdoVBvP21FnnuoBHFe_SZAnCpE/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1RxutoJHdoVBvP21FnnuoBHFe_SZAnCpE/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 13:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2000150#M82837</guid>
      <dc:creator>Yrstruly2021</dc:creator>
      <dc:date>2022-11-03T13:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Order Value per Region</title>
      <link>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2003300#M83071</link>
      <description>&lt;P&gt;Hi. &lt;BR /&gt;I didn't understand very well the problem. &lt;BR /&gt;I send you an idea for how to solve the query. &lt;BR /&gt;I hope this script can help you. &lt;BR /&gt;Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AVG_TMP:&lt;BR /&gt;Load *,&lt;BR /&gt;Month(ORDERDATE) as [MONTH ORDERDATE]&lt;BR /&gt;;&lt;BR /&gt;SQL SELECT A.TOTALPRICE, A.ORDERDATE AS Order Value&lt;BR /&gt;FROM Orders as A Join Customer AS B&lt;BR /&gt;ON B.Custkey = A.Custkey&lt;BR /&gt;JOIN Nation as C &lt;BR /&gt;ON C.Nationkey=B.Nationkey&lt;BR /&gt;JOIN Region as D &lt;BR /&gt;ON C.Regionkey=D.Regionkey&lt;BR /&gt;where D.Name = 'Africa' ;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;AVG:&lt;BR /&gt;Load &lt;BR /&gt;[MONTH ORDERDATE],&lt;BR /&gt;avg(TOTALPRICE) as [AVG TOTALPRICE]&lt;BR /&gt;Resident AVG_TMP&lt;BR /&gt;Group by [MONTH ORDERDATE];&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 00:16:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2003300#M83071</guid>
      <dc:creator>EdgarOlmos</dc:creator>
      <dc:date>2022-11-11T00:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Order Value per Region</title>
      <link>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2003378#M83081</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/157017"&gt;@Yrstruly2021&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not downloaded your data, but I am sure based schema you should be able to get to your required answer trying the following. &lt;BR /&gt;Create a month field in your script, as suggested by Edgar.&lt;BR /&gt;I would do it this way, "Date(MonthStart(ORDERDATE), 'MMM yyyy') as yearmonth".&lt;/P&gt;
&lt;P&gt;On your selected chart, add the yearmonth field as dimension and create a measure for your average order value.&lt;BR /&gt;"sum ( {$&amp;lt;Region={Africa}&amp;gt;} OrderPrice) / Count(&amp;nbsp;{$&amp;lt;Region={Africa}&amp;gt;}&amp;nbsp; distinct orderkey)"&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 07:14:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Order-Value-per-Region/m-p/2003378#M83081</guid>
      <dc:creator>williejacobs</dc:creator>
      <dc:date>2022-11-11T07:14:43Z</dc:date>
    </item>
  </channel>
</rss>

