<?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: Last 3 Month Average Calculation based on Dimensional selection in the Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762140#M454102</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/92390"&gt;@Lakshminarayanan_J&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you provide the sample data to analysis further.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2020 06:25:47 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2020-11-17T06:25:47Z</dc:date>
    <item>
      <title>Last 3 Month Average Calculation based on Dimensional selection in the Table</title>
      <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1761825#M454080</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;Our Requirement is to build the Adhoc Report which need to display the Measure Based on Dimension selection.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expression Logic Stock In Take&lt;/STRONG&gt;:Current Month Closing Value/Last 3 Month Sales Value /3*30&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expression Used and Working Fine in Text Box&lt;/STRONG&gt; :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;num((Sum({&amp;lt;Date_SecSales_Monthend=,Month_No=&amp;gt;}Closing_Value)/&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;((Sum(Aggr(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;RangeSum(Above(Sum({&amp;lt;Date_SecSales_Monthend=,Month_No=,Month=&amp;gt;}Sales_Value/3), 0, 3))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;, Month)))))*30,'#,##0'))&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But In Adhoc Report &lt;STRONG&gt;Above&lt;/STRONG&gt; Expression is not working and data are not displaying :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dimensional In Adhoc Report are below :&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;BU&lt;/TD&gt;&lt;TD&gt;Region&lt;/TD&gt;&lt;TD&gt;Area&lt;/TD&gt;&lt;TD&gt;Territory&lt;/TD&gt;&lt;TD&gt;Distributor Code&lt;/TD&gt;&lt;TD&gt;Distributor&lt;/TD&gt;&lt;TD&gt;District&lt;/TD&gt;&lt;TD&gt;Brand&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly Help Us on Building the Expression in Table which need to Display Data based on Dimensional selection.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/99838"&gt;@tm_burgers&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/13015"&gt;@eliasneif&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/24026"&gt;@kdmarkee&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/58578"&gt;@edwin&lt;/a&gt;&amp;nbsp;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336" target="_blank"&gt;@Kush&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:37:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1761825#M454080</guid>
      <dc:creator>Lakshminarayanan_J</dc:creator>
      <dc:date>2024-11-15T23:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Last 3 Month Average Calculation based on Dimensional selection in the Table</title>
      <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762082#M454099</link>
      <description>&lt;P&gt;i would not solution this via expression.&amp;nbsp; i would build a bridge for this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;assuming your measure ClosingValue is by day (FactDate),&amp;nbsp; (if just end of month, it will be simpler)&lt;BR /&gt;i would associate each date with the full 3 months of prior Sales.&amp;nbsp; assuming that you only have a single date (FactDate) for both closing and sales date.&lt;/P&gt;&lt;P&gt;with Dimension Month, your expression will just be sum({&amp;lt;DateType={'CURRENT'}&amp;gt;}ClosingValue)/Sum({&amp;lt;DateType={'3MONTHSBACK'}&amp;gt;}Sales) /3 * 30&lt;/P&gt;&lt;P&gt;since the closing monthend is already associated with the 3 months of sales data, you dont need any complicated set analysis condition for the sales. this is how you build that bridge:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calendar:
load date(today()-RowNo()) as Date;
load 1 as num AutoGenerate(365);

Fact:
load Date as FactDate, 'CLOSING' as Fact, floor(Rand()*10000)/100 as CloseValue Resident Calendar;

Concatenate (Fact)
load Date as FactDate, 'SALES' as Fact, floor(Rand()*10000)/100 as SalesAmount Resident Calendar;

NoConcatenate
tmpBridge:
load Date Resident Calendar;

inner join (tmpBridge) 
load Date as FactDate Resident Calendar;

NoConcatenate
Bridge:
load Date, FactDate, '3MONTHSBACK' as DateType Resident tmpBridge
where MonthStart(FactDate)&amp;gt;=AddMonths(MonthStart(Date),-3) 
and MonthStart(FactDate)&amp;lt;=AddMonths(MonthStart(Date),-1);

Concatenate (Bridge)
load Date, Date as FactDate, 'CURRENT' as DateType Resident Calendar;

drop table tmpBridge;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;in the attached pic, the first chart is the straight totals per month.&amp;nbsp; the second chart is the total close per month and the corresponding prior 3 months of sales&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762082#M454099</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-11-16T21:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Last 3 Month Average Calculation based on Dimensional selection in the Table</title>
      <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762083#M454100</link>
      <description>&lt;P&gt;BTW, shouldnt you be dividing by count(distinct {&amp;lt;DateType={'3MONTHSBACK'}&amp;gt;}FactDate) instead of 30?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:26:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762083#M454100</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-11-16T21:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Last 3 Month Average Calculation based on Dimensional selection in the Table</title>
      <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762139#M454101</link>
      <description>&lt;P&gt;Hi Edwin,&lt;/P&gt;&lt;P&gt;Thanks for the response , Need a clarification on a Bridge,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We already have the sales_Value and Closing_Value in the table , Kindly let me know why we are creating the both the field in&amp;nbsp; Bridge table.&lt;/LI&gt;&lt;LI&gt;We need to display data based on Dimensional data like Area,Region, Territory not on month wise.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Kindly help us in clarifying on this ,&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 06:11:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762139#M454101</guid>
      <dc:creator>Lakshminarayanan_J</dc:creator>
      <dc:date>2020-11-17T06:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Last 3 Month Average Calculation based on Dimensional selection in the Table</title>
      <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762140#M454102</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/92390"&gt;@Lakshminarayanan_J&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you provide the sample data to analysis further.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 06:25:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762140#M454102</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2020-11-17T06:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last 3 Month Average Calculation based on Dimensional selection in the Table</title>
      <link>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762934#M454128</link>
      <description>&lt;P&gt;The purpose of the bridge is to create a relationship between the date you selected and the dates applicable to your expression:&lt;BR /&gt;DateType CURRENT - means one to one.&amp;nbsp; select Oct 5, 2020 and it is related to all Oct 5, 2020 rows in your fact table&lt;/P&gt;&lt;P&gt;3MONSBACK - means one selection will relate to all the rows in your fact with dates representing the whole month 3 months back.&lt;/P&gt;&lt;P&gt;the bridge does not contain any measure.&amp;nbsp; you may have confused the part of the script where i have these measures - it is there just to simulate your fact table.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 13:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-3-Month-Average-Calculation-based-on-Dimensional-selection/m-p/1762934#M454128</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-11-19T13:31:57Z</dc:date>
    </item>
  </channel>
</rss>

