<?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: How to calculate Yesterday's Sales using YR_DAYS field from Master Calendar in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931879#M10735</link>
    <description>&lt;P&gt;Thank you for your feedback. While this solution would work in general, our master calendar is designed to handle US holidays. Any way to use the YR_DAYS field in the above table?&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 14:56:55 GMT</pubDate>
    <dc:creator>mdoll49</dc:creator>
    <dc:date>2022-05-17T14:56:55Z</dc:date>
    <item>
      <title>How to calculate Yesterday's Sales using YR_DAYS field from Master Calendar</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931239#M10728</link>
      <description>&lt;P&gt;We use a master calendar as shown below. I need to know how to use set analysis to calculate Sum(Sales) for Yesterday's sales using the YR_DAYS field in the below image. Using this field, I'd like to be able to sum Friday, Saturday and Sunday combined as "Yesterday" on a given Monday. Each other day would simply calculate the day prior. Any help would be greatly appreciated!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mdoll49_0-1652721052183.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/79531i27F68CCC12B40B1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mdoll49_0-1652721052183.png" alt="mdoll49_0-1652721052183.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 17:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931239#M10728</guid>
      <dc:creator>mdoll49</dc:creator>
      <dc:date>2022-05-16T17:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Yesterday's Sales using YR_DAYS field from Master Calendar</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931537#M10730</link>
      <description>&lt;P&gt;=if(Day(Today()='Mon'&lt;/P&gt;
&lt;P&gt;,sum({&amp;lt;INVOIDE_DATE={"&amp;gt;=$(=Date(Today()-3,'YYYY-MM-DD 00:00:00'))&amp;lt;=$(=Date(Today()-1,&lt;SPAN&gt;'YYYY-MM-DD 00:00:00'&lt;/SPAN&gt;))"}&amp;gt;}Sales)&lt;/P&gt;
&lt;P&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;INVOIDE_DATE={"$(=Date(Today()-1,&lt;/SPAN&gt;&lt;SPAN&gt;'YYYY-MM-DD 00:00:00'&lt;/SPAN&gt;&lt;SPAN&gt;))"}&amp;gt;}Sales)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would suggest you remove the time part from the INVOICE_DATE field as below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Date(Floor(INVOICE_DATE)) as INVOICE_DATE&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 08:30:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931537#M10730</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-05-17T08:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Yesterday's Sales using YR_DAYS field from Master Calendar</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931879#M10735</link>
      <description>&lt;P&gt;Thank you for your feedback. While this solution would work in general, our master calendar is designed to handle US holidays. Any way to use the YR_DAYS field in the above table?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 14:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931879#M10735</guid>
      <dc:creator>mdoll49</dc:creator>
      <dc:date>2022-05-17T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Yesterday's Sales using YR_DAYS field from Master Calendar</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931916#M10736</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming. Latest date available is today's date then max(yr_days,2) will return yesterdays date i.e. second max value&lt;/P&gt;
&lt;P&gt;If the laste date available in your dataset is yesterday, then simply use&amp;nbsp;max(yr_days) For yesterdays date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I've assumed data is available until yesterday&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=if(Day(today())='Mon'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;,sum({&amp;lt;INVOIDE_DATE={"&amp;gt;=max(YR_DAYS,3)&amp;lt;=max(YR_DAYS)"}&amp;gt;}Sales)&lt;/P&gt;
&lt;P&gt;,&lt;/P&gt;
&lt;P&gt;sum({&amp;lt;INVOIDE_DATE={"=MAX(YR_DAYS)"}&amp;gt;}Sales)&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 15:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931916#M10736</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-05-17T15:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Yesterday's Sales using YR_DAYS field from Master Calendar</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931958#M10737</link>
      <description>&lt;P&gt;Unfortunately, the MAX(YR_DAYS) would always yield 254 for the total number of selling days from the calendar.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to do some kind of lookup on the invoice date to pull in the YR_DAYS that correspond?&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 17:07:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-calculate-Yesterday-s-Sales-using-YR-DAYS-field-from/m-p/1931958#M10737</guid>
      <dc:creator>mdoll49</dc:creator>
      <dc:date>2022-05-17T17:07:31Z</dc:date>
    </item>
  </channel>
</rss>

