<?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 Average sales per weekday in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366991#M493843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It could be caused by the format within your [Day Name] column. Give it a try with &lt;STRONG&gt;num(weekday(today(0)))&lt;/STRONG&gt; or alternatively &lt;STRONG&gt;text(weekday(today(0)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is your column populated ? If its plain text, make sure that the weekday function returns the same day name format - including probably abbreviations&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Apr 2012 07:51:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-25T07:51:27Z</dc:date>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366987#M493839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm creating a daily sales report and need to compare today's sales against the same day's average over the last 4 weeks. For instance, today I would show Wednesday's sales, the average of the last 4 Wednesday's sales and the difference between them. I'm currently having issues getting Wednesday's sales to show. I'm using the following set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;sum&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;[Day Name]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;'$(=weekday(today(0))'&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;[Sales]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;If&amp;nbsp; I replace the above with today's day, it works fine, but I need something dynamic:&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;sum&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;[Day Name]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;"Wednesday"&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;[Sales]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;Once I get this sorted, I'll need to sum the sales from the last 4 Wednesdays. Does anyone know an expression for this?&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Any insight would be appreciated. I've attached an example below.&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Best,&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 06:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366987#M493839</guid>
      <dc:creator />
      <dc:date>2012-04-25T06:50:52Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366988#M493840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;just add a second set expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({$&amp;lt; &lt;STRONG&gt;SalesDate = {'&amp;gt;=$(=&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;AddMonths(Now(0), -1))'}&lt;/STRONG&gt;&lt;SPAN class="s2"&gt; ,&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;[Day Name]&lt;/SPAN&gt;&lt;SPAN class="s2"&gt; = {&lt;/SPAN&gt;&lt;EM&gt;'$(=weekday(today(0))'&lt;/EM&gt;&lt;SPAN class="s2"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;[Sales]&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;greets, &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;Max&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:07:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366988#M493840</guid>
      <dc:creator />
      <dc:date>2012-04-25T07:07:22Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366989#M493841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Max, that's very helpful. I still cannot get this part of the expression to work though:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s3" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;[Day Name]&lt;/SPAN&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt; = {&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;'$(=weekday(today(0))'&lt;/EM&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;If I subsitute &lt;/SPAN&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;{&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;'$(=weekday(today(0))'&lt;/EM&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;} for&amp;nbsp; {"Wednesday"} it works, but I need it to work dynamically. Does anything stand out to you as wrong with this expression?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2" style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366989#M493841</guid>
      <dc:creator />
      <dc:date>2012-04-25T07:38:16Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366990#M493842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the result of your formula weekday(today(0)) in a text box. If it does not return 'Wednesday', modify environment variable DayNames in the load script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366990#M493842</guid>
      <dc:creator>masha-ecraft</dc:creator>
      <dc:date>2012-04-25T07:50:23Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366991#M493843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It could be caused by the format within your [Day Name] column. Give it a try with &lt;STRONG&gt;num(weekday(today(0)))&lt;/STRONG&gt; or alternatively &lt;STRONG&gt;text(weekday(today(0)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is your column populated ? If its plain text, make sure that the weekday function returns the same day name format - including probably abbreviations&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 07:51:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366991#M493843</guid>
      <dc:creator />
      <dc:date>2012-04-25T07:51:27Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366992#M493844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the help, really appreciate it. I still had issues getting the weekday expression to work. In the end, I've settled on the following solution to calculate yesterday's sales against the&amp;nbsp; average for last 4 like weekdays:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;(sum({$&amp;lt; [Transaction Date] = {'$(=date(today(0)-8))'}&amp;gt;} [Sales]) +&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt; [Transaction Date] = {'$(=date(today(0)-15)'}&amp;gt;} [Sales]) +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt; [Transaction Date] = {'$(=date(today(0)-22))'}&amp;gt;} [Sales]) +&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({$&amp;lt; [Transaction Date] = {'$(=date(today(0)-29))'}&amp;gt;} [Sales]) )/4&lt;/P&gt;&lt;P class="p2"&gt;&lt;/P&gt;&lt;P class="p2"&gt;Best,&lt;/P&gt;&lt;P class="p2"&gt;&lt;/P&gt;&lt;P class="p2"&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 10:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366992#M493844</guid>
      <dc:creator />
      <dc:date>2012-04-25T10:20:17Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366993#M493848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you have day name field?if so check with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({&amp;lt;DayField={'$(=WeekDay(Today()))'},&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;[Transaction Date]={"&amp;gt;=$(=Date(today()-29))&amp;lt;=$(=Date(Today()-6))"}&lt;/SPAN&gt;&amp;gt;} Sales)/4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To simplify yours as one expression you can write like this&lt;/P&gt;&lt;P class="p1" style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;sum({$&amp;lt; [Transaction Date] = {'$(=date(today(0)-8))',&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;'$(=date(today(0)-15)',&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;'$(=date(today(0)-22))',&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;'$(=date(today(0)-29))'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;}&amp;gt;} [Sales])/4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 12:37:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366993#M493848</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-04-25T12:37:53Z</dc:date>
    </item>
    <item>
      <title>Average sales per weekday</title>
      <link>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366994#M493849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the help Celambarasan. Those queries are much cleaner/lighter than mine, however, I couldn't get either to work so will stick with what I have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 06:51:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-sales-per-weekday/m-p/366994#M493849</guid>
      <dc:creator />
      <dc:date>2012-04-27T06:51:05Z</dc:date>
    </item>
  </channel>
</rss>

