<?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: Set Analysis and AGGR and IF Function not working... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682851#M247572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks für your quick replys!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Gabriel&lt;/P&gt;&lt;P&gt;Sorry, I'm not able to upload any data at the moment... it sounds good with the load thing, but as I am new to QV I dont know how to do this... where in the script should I do this? And how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Muhammad&lt;/P&gt;&lt;P&gt;This function looks nice, but how do I get the start and end date to be the selected month?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas so far?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 06:19:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-09T06:19:08Z</dc:date>
    <item>
      <title>Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682848#M247569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to Qlikview and currently having Problems with the If/AGGR/ and Set Analysis.&lt;/P&gt;&lt;P&gt;In my case I have the following Sales-Data from one month as a Table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vendor, Date, Quantity, Sales and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do, is getting the average Quantities per Day during one month per Vendor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like: sum of Quantities of August 2014 / Number of Working Days of the Vendor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this I will need at first the amount of Days that the Vendor had orders. For this I used the Count function in a Pivot table as an Expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count (Distinct Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now comes the difficulty... Orders can also be placed on a Saturday or Sunday, but these days should not be included as they do not belong to the working days (Mon - Fri). So I only want to count the distinct Dates of the month during Mon - Fri&amp;nbsp; where every Vendor sold a product...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a master calendar where the function "weekday(Date)" delivers the weekday in a short form in german (e.g. "So" , "Sa" ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that I tried the following Expression in a Pivot table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(weekday(Date) &amp;lt;&amp;gt; 'So', if(weekday(Date) &amp;lt;&amp;gt; 'Sa', Count(distinct (Date)))&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;I get no error on the expression, but the result is still all distinct days including Saturday and Sundays...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(Count({&amp;lt;weekday(Date) -={'So','Sa'}&amp;gt;} distinct Date), Vendor)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Expression has again "no error" but this time I cant get any results with it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried to create another column with "1" for Workday and "0" for Weekends:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(weekday(Date) &amp;lt;&amp;gt; 'So',&amp;nbsp; if( weekday(Date) &amp;lt;&amp;gt; 'Sa', 1,0),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked for the rows when I showed the Date Column in the Pivot Table, but when I tried to sum it afterwards.. again I received the total days including the Weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone can understand my issue here and help me out to get average sales based on the amount of working days!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 15:05:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682848#M247569</guid>
      <dc:creator />
      <dc:date>2014-10-08T15:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682849#M247570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that is better to you create on your load a field with the weekDay, and use it on the set analysis. I'm not sure if Set Analysis works using something like WeekDay(Date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, this way you could use something like this on your count:&lt;/P&gt;&lt;P&gt;=count({&amp;lt;Week_Day-={'so','sa'}&amp;gt;} Distinct Date)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you attach here some qvw file with sample data or an spreadsheet with the data that you want to load? It would be easier find the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gabriel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 16:28:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682849#M247570</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-08T16:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682850#M247571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;Try to use his function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;networkdays (&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;start:date, end_date {, holiday}&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 16:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682850#M247571</guid>
      <dc:creator>arsal_90</dc:creator>
      <dc:date>2014-10-08T16:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682851#M247572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks für your quick replys!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Gabriel&lt;/P&gt;&lt;P&gt;Sorry, I'm not able to upload any data at the moment... it sounds good with the load thing, but as I am new to QV I dont know how to do this... where in the script should I do this? And how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Muhammad&lt;/P&gt;&lt;P&gt;This function looks nice, but how do I get the start and end date to be the selected month?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas so far?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 06:19:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682851#M247572</guid>
      <dc:creator />
      <dc:date>2014-10-09T06:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682852#M247573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ muhammad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing... will this function recognize when vendor A has only 20 days where he sold products and vendor B has 17? Or will it just give the distinct number of days over all vendors? (which is not what I need...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 06:26:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682852#M247573</guid>
      <dc:creator />
      <dc:date>2014-10-09T06:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682853#M247574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To create a week field (named &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Week_Day) &lt;/SPAN&gt;on the LOAD, you just use this on the same LOAD that you bring your Date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WeekDay(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Date) as Week_Day&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 10:29:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682853#M247574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-09T10:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis and AGGR and IF Function not working...</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682854#M247575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that worked so far!!! I will test this with a larger amount of data including several month...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would still like to know if the networkdays function can get the start and enddate from the selection of the master calendar...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks again for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 13:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-and-AGGR-and-IF-Function-not-working/m-p/682854#M247575</guid>
      <dc:creator />
      <dc:date>2014-10-09T13:18:24Z</dc:date>
    </item>
  </channel>
</rss>

