<?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: Calculation of measure based on Prior Week dates in Dashboards &amp; Analytics Discussions</title>
    <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3602#M292</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.incorta.com/t5/user/viewprofilepage/user-id/697"&gt;@mrossPM2&lt;/a&gt;&amp;nbsp;, It worked perfectly&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 23:28:30 GMT</pubDate>
    <dc:creator>msinha8</dc:creator>
    <dc:date>2023-01-17T23:28:30Z</dc:date>
    <item>
      <title>Calculation of measure based on Prior Week dates</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3594#M290</link>
      <description>&lt;P&gt;Hello Gurus&lt;/P&gt;&lt;P&gt;We have an requirement where we have to calculate the previous week's (week start from Monday to Sunday) amount based on passed date (Default to current date).&lt;/P&gt;&lt;P&gt;For e.g.&lt;/P&gt;&lt;TABLE width="269"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="269"&gt;Table A (Calendar Table)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Day&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/1/2023&lt;/TD&gt;&lt;TD&gt;Sunday&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/2/2023&lt;/TD&gt;&lt;TD&gt;Monday&lt;/TD&gt;&lt;/TR&gt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&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE width="240"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="240"&gt;Table B (Transaction Table)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/2/2023&lt;/TD&gt;&lt;TD&gt;$100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/4/2023&lt;/TD&gt;&lt;TD&gt;$150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/6/2023&lt;/TD&gt;&lt;TD&gt;$200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/8/2023&lt;/TD&gt;&lt;TD&gt;$400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/10/2023&lt;/TD&gt;&lt;TD&gt;$300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/11/2023&lt;/TD&gt;&lt;TD&gt;$250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/12/2023&lt;/TD&gt;&lt;TD&gt;$500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/13/2023&lt;/TD&gt;&lt;TD&gt;$600&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;Assuming, I am running the report as of date 1/14/2023 (Saturday), the required out put is :&lt;/P&gt;&lt;TABLE width="240"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="176"&gt;Date&lt;/TD&gt;&lt;TD width="64"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/14/2023&lt;/TD&gt;&lt;TD&gt;$850&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Running as of date 01/17/2023(Tuesday), the required output is :&lt;/P&gt;&lt;TABLE width="240"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="176"&gt;Date&lt;/TD&gt;&lt;TD width="64"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1/17/2023&lt;/TD&gt;&lt;TD&gt;$1,650&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;any pointers for this will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mritunjay&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 19:13:46 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3594#M290</guid>
      <dc:creator>msinha8</dc:creator>
      <dc:date>2023-01-17T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of measure based on Prior Week dates</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3601#M291</link>
      <description>&lt;P&gt;Hello Mritunjay,&lt;/P&gt;&lt;P&gt;I was able to use your sample data to create a dashboard that returns the expected results. My solution uses the selected date as a Presentation Variable on the dashboard, which is in turn referenced in Applied Filters used to filter the results of the transactions table.&lt;/P&gt;&lt;P&gt;I created a new dashboard and went to Manage Dashboard Filters. I created a new Presentation Variable with the following properties:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datevariable.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/1889iC5663E8E950AAB24/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="datevariable.png" alt="datevariable.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I created an Applied Filter that uses a formula column to determine which date was last Monday based on what was selected in the variable. Incorta assumes the first day of the week is Sunday, so I have to subtract six days from the weekStartDate() value to get the date of the prior Monday. I include the greater than or equal to operator so this is used as the start of the date range.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lastmonday.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/1885iDCC00A9D105C2B23/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="lastmonday.png" alt="lastmonday.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Next I create another Applied Filter that will filter on last Sunday. As I mentioned previously, the weekStartDate() formula will return the value of Sunday. Since this is the upper limit of the date range we want to use, I include the less than or equal to operator.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lastsunday.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/1886i9E225784009DA9C6/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="lastsunday.png" alt="lastsunday.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now that my variable and filters have been setup, I can create the insights that return the values I want to see. I have an aggregated table that sums up the values to return the value you want, a detailed listing table with the individual transactions, and a table that shows the last Monday and Sunday values from the formula. Here are the screenshots for your two date examples.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jan14.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/1887iDEA90ECA7922558D/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="jan14.png" alt="jan14.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jan17.png" style="width: 400px;"&gt;&lt;img src="https://community.incorta.com/t5/image/serverpage/image-id/1888i18E64663670D0FD3/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="jan17.png" alt="jan17.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope that helps solve your problem!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 20:39:42 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3601#M291</guid>
      <dc:creator>mrossPM2</dc:creator>
      <dc:date>2023-01-17T20:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of measure based on Prior Week dates</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3602#M292</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.incorta.com/t5/user/viewprofilepage/user-id/697"&gt;@mrossPM2&lt;/a&gt;&amp;nbsp;, It worked perfectly&lt;span class="lia-unicode-emoji" title=":clapping_hands:"&gt;👏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 23:28:30 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3602#M292</guid>
      <dc:creator>msinha8</dc:creator>
      <dc:date>2023-01-17T23:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of measure based on Prior Week dates</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3604#M294</link>
      <description>&lt;P&gt;Great solution&amp;nbsp;&lt;a href="https://community.incorta.com/t5/user/viewprofilepage/user-id/697"&gt;@mrossPM2&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 15:52:29 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculation-of-measure-based-on-prior-week-dates/m-p/3604#M294</guid>
      <dc:creator>JoeM</dc:creator>
      <dc:date>2023-01-18T15:52:29Z</dc:date>
    </item>
  </channel>
</rss>

