<?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 Calculate Measure value for current week and prior week in Dashboards &amp; Analytics Discussions</title>
    <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5507#M632</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have Period Name like Jan-24, using this column i want to calculate the measure value for current week and prior week.&lt;/P&gt;&lt;P&gt;Please let me know how to achieve?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2024 12:47:25 GMT</pubDate>
    <dc:creator>KHK</dc:creator>
    <dc:date>2024-02-28T12:47:25Z</dc:date>
    <item>
      <title>Calculate Measure value for current week and prior week</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5507#M632</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I have Period Name like Jan-24, using this column i want to calculate the measure value for current week and prior week.&lt;/P&gt;&lt;P&gt;Please let me know how to achieve?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 12:47:25 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5507#M632</guid>
      <dc:creator>KHK</dc:creator>
      <dc:date>2024-02-28T12:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Measure value for current week and prior week</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5510#M633</link>
      <description>&lt;P&gt;To get a practical answer you'll need to provide some more information, but conceptually there are a few ways to get relative time measures.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;One I've found effective is using an input date ( could be "today," or a prompted session variable, or another calculation ) to look up the period in the calendar and use that in a CASE statement&amp;nbsp; ( more accurately w/in the case function in Incorta )&amp;nbsp;&lt;/P&gt;&lt;P&gt;case(lookup(&amp;lt;period&amp;gt;, $current_date ) = 'Jan-24', &amp;lt;measure&amp;gt;, 0 )&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'd need to confirm business rules e.g. fiscal v Gregorian calendar, does current date mean *today* today, or yesterday because we loaded data overnight and yesterday is the most current, etc.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 13:35:16 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5510#M633</guid>
      <dc:creator>RADSr</dc:creator>
      <dc:date>2024-03-01T13:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Measure value for current week and prior week</title>
      <link>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5515#M634</link>
      <description>&lt;P&gt;Here's a formula I did w/ the online store data - it's business logic is incomplete as it doesn't account for the year, but it'll give you a starting point.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;The insight shows line total dollar amounts for January and zeros for everything else.&amp;nbsp;&lt;/P&gt;&lt;P&gt;BIG NOTE:&amp;nbsp; The time_dimension in the onlinestore schema defines the "id" field as its key.&amp;nbsp; &amp;nbsp;In order for this formula to work you need to set "id" to dimension and "db_date" as the key.&amp;nbsp; &amp;nbsp; The formula **will not error** if you don't, but will produce either nulls or the word #ERROR in your insight.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;====================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;case(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&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t;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;OnlineStore.time_dimension.month_name&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;OnlineStore.salesorderdetail.LineTotal&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Mar 2024 15:05:41 GMT</pubDate>
      <guid>https://community.incorta.com/t5/dashboards-analytics-discussions/calculate-measure-value-for-current-week-and-prior-week/m-p/5515#M634</guid>
      <dc:creator>RADSr</dc:creator>
      <dc:date>2024-03-01T15:05:41Z</dc:date>
    </item>
  </channel>
</rss>

