<?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 many days does a week have? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532540#M198956</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;it seems that just now everything is all right. In most apps, I have some textboxes with historical values, usually the past week and the past month - so I can see immediately whether the status is right or wrong.&lt;/P&gt;&lt;P&gt;However, I am still not sure about this:&lt;/P&gt;&lt;P&gt;I can well live with Saturday being included in the avg calculation ((Mo+...+Sat)/6). There might or might not be data for Sat, but that is something we have to cope with.&lt;/P&gt;&lt;P&gt;What about Sunday, however? In many Excel lists, there is a field for every Sunday and, of course, a 0 for value. Some of them I cannot edit. If that were included in the avg calculation, it would mess it up a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a set_expression to calculate the avg for the past week and compare that to the target value.&lt;/P&gt;&lt;P&gt;Is there a way I can make this calculation take into account only Mo-Sat?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Aug 2013 10:19:52 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2013-08-28T10:19:52Z</dc:date>
    <item>
      <title>How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532535#M198951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a very trivial question - and I already have an inkling what the answer is. I just want it confirmed - and it would be nice to know how I might change it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The background is, I have a status_traffic_light that calculates the avg of the past week (currently week #34) and if it exceeds the target_value, the traffic_light is green, otherwise it is red.&lt;/P&gt;&lt;P&gt;Just now, the light was red though we made good figures from Mo to Fri. There was no data on Saturday.&lt;/P&gt;&lt;P&gt;Now I edited the formula in the underlying Excel sheet so when there is no data, the target value appears. Now the light is green, but by simply calculating the avg, I guess that a week in QlikView still has seven days - normal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in some diagrams, I calculate the avg to be able to display monthly figures - and that traffic_light usually uses an avg, too.&lt;/P&gt;&lt;P&gt;Now, how can I change that so that a week has only six days - or would that mess up my monthly figures?&lt;/P&gt;&lt;P&gt;That would still not be quite correct as we don't work every Saturday, but it would be closer as we never work on Sundays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 15:15:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532535#M198951</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-26T15:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532536#M198952</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;You might need a SharePoint list to record holidays in a yer so that you could exclude them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you might consider days that are not saturdays or sundays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 15:35:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532536#M198952</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-08-26T15:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532537#M198953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you could use the function NetWorkDays() that automatically excludes weekends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could use Advanced Aggregation (AGGR) to always calculate daily averages (without dividing by the number of days). This way, if there is any data on a Saturday, it can be included, and if there isn't, it would not be included...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 16:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532537#M198953</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-08-26T16:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532538#M198954</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;@Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right - I don't care about holidays, I just want to exclude weekends - rather, only Sundays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Oleg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot calculate any daily averages, there is just one discrete value per day - underlying is a manually populated Excel list. I have now set the formula (in one diagram, but it seems a good idea for all) to always return the target_value if there is no data. That way, an average would not be altered and I can just always include Saturdays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I think that just about solves my problem - if I have two additional days (Sat and Sun) without data, the list just returns the target_value. I guess I have to adapt this so that it just returns 1, then the average should stay exactly the same, shouldn't it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Hmm - that is easy enough and for one of my metrics where the target_value is 1.4 - but for the other it is 37.6, so assuming 1 when there is no data would lower the average quite a lot. Maybe assuming the target_value is the safer way to go - that way, figures will be a little queer, but still close.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 07:07:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532538#M198954</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-27T07:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532539#M198955</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;You might create a snapshot as well. This will accept a startdate and a end date (say today) and then generate the dates. Next for the date it will have the target value. We can have a day as well. When we create a expression then we exclude day equals saturday. Not so sure if this makes good sense though. Just a thought.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 08:00:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532539#M198955</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-08-27T08:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532540#M198956</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;it seems that just now everything is all right. In most apps, I have some textboxes with historical values, usually the past week and the past month - so I can see immediately whether the status is right or wrong.&lt;/P&gt;&lt;P&gt;However, I am still not sure about this:&lt;/P&gt;&lt;P&gt;I can well live with Saturday being included in the avg calculation ((Mo+...+Sat)/6). There might or might not be data for Sat, but that is something we have to cope with.&lt;/P&gt;&lt;P&gt;What about Sunday, however? In many Excel lists, there is a field for every Sunday and, of course, a 0 for value. Some of them I cannot edit. If that were included in the avg calculation, it would mess it up a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a set_expression to calculate the avg for the past week and compare that to the target value.&lt;/P&gt;&lt;P&gt;Is there a way I can make this calculation take into account only Mo-Sat?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 10:19:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532540#M198956</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-28T10:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532541#M198957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way to limit your calculation to weekdays only is to create a new calendar field, Weekday_Flag and to assign 1 for all weekdays and 0 for all weekend days (you can do it in the script, where you generate your master calendar). Then, in the expression, you simply add one more Set Analysis modifier:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Weekday_Flag={1}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 16:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532541#M198957</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-08-28T16:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532542#M198958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that sounds very good. Actually, I think there is already such a weekday_flag in the calendar.&lt;/P&gt;&lt;P&gt;So I can just say (in the set_expression) like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; Week=(Week(TODAY())-1), weekday_flag={1} &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;can I not?&lt;/P&gt;&lt;P&gt;Wonderful!&lt;/P&gt;&lt;P&gt;I haven't yet had a case where the status_light was definitely wrong, but I guess that would be the safer way to go.&lt;/P&gt;&lt;P&gt;I can also create a second weekday_flag so that one would encompass only Mo-Fri and one would encompass Mo-Sat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 06:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532542#M198958</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2013-08-29T06:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: How many days does a week have?</title>
      <link>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532543#M198959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, exactly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 16:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-many-days-does-a-week-have/m-p/532543#M198959</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-08-29T16:26:36Z</dc:date>
    </item>
  </channel>
</rss>

