<?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 Multiple Tables. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749055#M591550</link>
    <description>&lt;P&gt;Thanks for the feedback, I tried the above, but I think I am missing something coz its not working. Anyhow, I have attached a sample of what the data looks like.&lt;/P&gt;&lt;P&gt;Again Calendar table only shows value for Number_Business_Days on the first business day of the month. I have also attached the expected chart.&lt;/P&gt;&lt;P&gt;If you look at it, one of the products is missing values for all the months except for June. That's because we don't have sales on the 'first_business_day' in these months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps explain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2020 05:51:23 GMT</pubDate>
    <dc:creator>ruzvmun</dc:creator>
    <dc:date>2020-10-02T05:51:23Z</dc:date>
    <item>
      <title>Set Analysis Multiple Tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749044#M591548</link>
      <description>&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;First post!! This is really a long shot, I hope I ask this correctly. I have 2 tables, one &lt;STRONG&gt;Sales&lt;/STRONG&gt; another &lt;STRONG&gt;Bus_Days_Calendar&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relationship between these tables is 'Date' and they are loaded individually in code therefore using QV joining.&lt;/P&gt;&lt;P&gt;Bus_Days_Calendar has a field 'Number_Business_Days' and is only populated for the first business Day of each month only, rest is 0. It shows the number of business days for that respective month.&lt;/P&gt;&lt;P&gt;I am trying to create a chart that shows average daily sales per month using the this field.&lt;/P&gt;&lt;P&gt;However QV is creating an inner join between the 2 tables such that it only populates the 'Number_Business_Days' when 'Date' matches between the 2 tables. So we have scenarios where the months are blank because they don't match between the 2 tables i.e no sales on 'First_business_Day' in the sales table.&lt;/P&gt;&lt;P&gt;The expression on the chart looks something like this:&lt;/P&gt;&lt;P&gt;(sum({&amp;lt;[Date] = {'&amp;gt;=$(vDate1) &amp;lt;=$(Date2)'}&amp;gt;} [Sales])&lt;BR /&gt;/&lt;BR /&gt;sum({&amp;lt;[Date] = {'&amp;gt;=$(Date1) &amp;lt;=$(Date2)'}&amp;gt;} Number_Business_Days)) /1000000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried doing this by month and year but because we have multiple 'Dates' in the Sales table, I end up having duplicates on the&amp;nbsp;Number_Business_Days therefore throwing off the numbers.&lt;/P&gt;&lt;P&gt;Do you guys know how I can go around this?&lt;/P&gt;&lt;P&gt;Appreciate any help provided.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 00:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749044#M591548</guid>
      <dc:creator>ruzvmun</dc:creator>
      <dc:date>2020-10-02T00:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Multiple Tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749050#M591549</link>
      <description>&lt;P&gt;What is the content of your variables? Are you using different variables in the two expressions or is it just a typo in your post? Does your work day table only contain the two fields or do you have more info in it? Are you presenting you data per date /month in your chart objects?&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try adding the full set {1} to your denominator like below. Even possible to use Monthstart in your first date comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(sum({&amp;lt;[Date] = {'&amp;gt;=$(vDate1) &amp;lt;=$(Date2)'}&amp;gt;} [Sales])&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;sum({&lt;STRONG&gt;1&lt;/STRONG&gt;&amp;lt;[Date] = {'&amp;gt;=&lt;STRONG&gt;$(=monthstart(&lt;/STRONG&gt;$(Date1)&lt;STRONG&gt;)&amp;nbsp;&lt;/STRONG&gt;&amp;lt;=$(Date2)'}&amp;gt;} Number_Business_Days)) /1000000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please try and let us know what happens.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 04:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749050#M591549</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2020-10-02T04:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Multiple Tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749055#M591550</link>
      <description>&lt;P&gt;Thanks for the feedback, I tried the above, but I think I am missing something coz its not working. Anyhow, I have attached a sample of what the data looks like.&lt;/P&gt;&lt;P&gt;Again Calendar table only shows value for Number_Business_Days on the first business day of the month. I have also attached the expected chart.&lt;/P&gt;&lt;P&gt;If you look at it, one of the products is missing values for all the months except for June. That's because we don't have sales on the 'first_business_day' in these months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps explain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 05:51:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749055#M591550</guid>
      <dc:creator>ruzvmun</dc:creator>
      <dc:date>2020-10-02T05:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Multiple Tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749110#M591552</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vegar_0-1601631759232.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41611i8A6BE82D598B5FAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Vegar_0-1601631759232.png" alt="Vegar_0-1601631759232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Try this expression.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;sum(Sales_Amt/100000)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/sum(total &amp;lt;Month_Short&amp;gt; Number_Business_Days)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See attached qvw.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 09:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749110#M591552</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2020-10-02T09:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Multiple Tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749270#M591554</link>
      <description>&lt;P&gt;This is good, I appreciate the prompt response. Works like a charm.&lt;/P&gt;&lt;P&gt;I did notice one thing though, my calendar table has 3 years worth of data..as such the 'business_days' value is multiplied by 3, therefore scewing the data.&lt;/P&gt;&lt;P&gt;I did a workaround by adding max instead of total on the bottom calculation:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;sum(Sales_Amt/100000)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/&lt;STRONG&gt;max&lt;/STRONG&gt;(total &amp;lt;Month_Short&amp;gt; Number_Business_Days)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Do you think this is the best way out.&lt;/P&gt;&lt;P&gt;I apologize my dataset was incomplete obviously, imagine we have sales from 2018-2020 as well in the calendar table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your time on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 16:21:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749270#M591554</guid>
      <dc:creator>ruzvmun</dc:creator>
      <dc:date>2020-10-02T16:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Multiple Tables.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749328#M591555</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;I&amp;nbsp; got a solution; so I updated my code for the calendar table and have business days value showing for every date in the month.&lt;/P&gt;&lt;P&gt;Then I tried the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;(sum({$&amp;lt;[Date] = {'&amp;gt;=$(vStart_Date) &amp;lt;=$(vPrev_Date)'} &amp;gt;} [Sales])&lt;BR /&gt;/&lt;BR /&gt;&amp;nbsp;Max({$&amp;lt;[Date] = {'&amp;gt;=$(vStart_Date) &amp;lt;=$(vPrev_Date)'} &amp;gt;} Business_Days) )&lt;/P&gt;&lt;P&gt;Validated the numbers and looks good.&lt;/P&gt;&lt;P&gt;Thanks for your assistance, much appreciated&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2020 01:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Multiple-Tables/m-p/1749328#M591555</guid>
      <dc:creator>ruzvmun</dc:creator>
      <dc:date>2020-10-03T01:34:23Z</dc:date>
    </item>
  </channel>
</rss>

