<?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: Expression Issues in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292182#M497503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks liron for ur reply. This solution helps me in getting the correct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh Mudgil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2011 09:01:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-29T09:01:00Z</dc:date>
    <item>
      <title>Expression Issues</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292180#M497501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing one issue that is i am having a scenario in which i have to calculate the number of working days and standars hours. I am attaching the XL file in which there are basically 6 fields i want to calculate number of working days and then standard hours correspondingly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenario is : Suppose there is an employee whose emp_number is 1101 whose Assignment(Asssdate) starts on 1-08-2011 and&amp;nbsp; ends(Asseddate) on 15-09-2011. So my requirement is to calculate number of working days and then standard hours basis on this date difference excluding saturday and sunday. I am using NetWorkDays() function for that but problem is that this report is prepare at the end of each month so if:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;StartDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;EndDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;EmpNo&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;EmpName&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Location&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Position&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Aug-2011&lt;/TD&gt;&lt;TD&gt;15-Sep-2011&lt;/TD&gt;&lt;TD&gt;11001&lt;/TD&gt;&lt;TD&gt;SSSS&lt;/TD&gt;&lt;TD&gt;Delhi&lt;/TD&gt;&lt;TD&gt;Assistant Manager&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16-Sep-2011&lt;/TD&gt;&lt;TD&gt;To present&lt;/TD&gt;&lt;TD&gt;11001&lt;/TD&gt;&lt;TD&gt;SSSS&lt;/TD&gt;&lt;TD&gt;Mumbai&lt;/TD&gt;&lt;TD&gt;Manager&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My start date is 1 aug 2011 and end date is 15 sep 2011 in between there are near about 33 working days excluding saturday,sunday. So if i want to see the report for aug month only then it will show the working days upto 30 aug 2011. And when i want to see the report for September month then it will show the results from 1-sep-2011 to 31-sep-2011 i.e half results are coming from the previous assignment and half from the present assignment. This particular employee is presently working as a Manager in Mumbai.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How i am calculating is : &lt;/P&gt;&lt;P&gt;I am making one variable named as MaxAssdate = IF( ISNULL(YearType),MAX(Asssddate), DATE(NUM(30) &amp;amp;'/' &amp;amp;MAX(CalendarMonthNum) &amp;amp; '/' &amp;amp; MAX(NUM(left(CalendarNumYearMonth,4))),'DD/MM/YYYY'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Working Days = &lt;/P&gt;&lt;P&gt;NetWorkDays(&lt;/P&gt;&lt;P&gt;(IF(Asssddate &amp;gt;= DATE(MONTHSTART(MaxAssdate),'DD/MM/YYYY'),DATE(Asssddate,'DD/MM/YYYY'),DATE(MONTHSTART(MaxAssdate),'DD/MM/YYYY'))),&lt;/P&gt;&lt;P&gt;(IF(Asseddate &amp;lt;= DATE(MonthEnd(MaxAssdate),'DD/MM/YYYY'),DATE(Asseddate,'DD/MM/YYYY'),IF(MONTH(DATE(MONTHEND(MaxAssdate),'DD/MM/YYYY'))=MONTH(TODAY()),&lt;/P&gt;&lt;P&gt;DATE(TODAY(),'DD/MM/YYYY'),DATE(MONTHEND(MaxAssdate),'DD/MM/YYYY'))))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Standard Hours:&lt;/P&gt;&lt;P&gt;I am making one variable sd = Count(DISTINCT&amp;nbsp; [EmpployeeNo&amp;amp;EmployeeName])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Hours : &lt;/P&gt;&lt;P&gt;if(&lt;/P&gt;&lt;P&gt;if(sd &amp;gt; 1, [Working Days] * (count(DISTINCT [EmpployeeNo&amp;amp;EmployeeName])*IF(LEFT(SU_Jobname,16)='Staff Accountant',7,8)),&lt;/P&gt;&lt;P&gt;if(NOOFROWS()&amp;gt;1,([Working Days] * (count(DISTINCT [EmpployeeNo&amp;amp;EmployeeName])*IF(LEFT(SU_Jobname,16)='Staff Accountant',7,8)))/TOTDAYS,&lt;/P&gt;&lt;P&gt; [Working Days] * (count(DISTINCT [EmpployeeNo&amp;amp;EmployeeName])*IF(LEFT(SU_Jobname,16)='Staff Accountant',7,8)))) &amp;gt; 184, 0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if(sd &amp;gt; 1, [Working Days] * (count(DISTINCT [EmpployeeNo&amp;amp;EmployeeName])*IF(LEFT(SU_Jobname,16)='Staff Accountant',7,8)),&lt;/P&gt;&lt;P&gt;if(NOOFROWS()&amp;gt;1,([Working Days] * (count(DISTINCT [EmpployeeNo&amp;amp;EmployeeName])*IF(LEFT(SU_Jobname,16)='Staff Accountant',7,8)))/TOTDAYS,&lt;/P&gt;&lt;P&gt; [Working Days] * (count(DISTINCT [EmpployeeNo&amp;amp;EmployeeName])*IF(LEFT(SU_Jobname,16)='Staff Accountant',7,8)))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a logic behind calculating standard hours i.e if SU_Jobname = 'Staff Accountant ' then take 7 hours as a working hours in a day otherwise taking 8 hours. But this logic is not working fine. Please let me know any other simple way to calculate this asp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching the XL file for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh Mudgil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 06:50:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292180#M497501</guid>
      <dc:creator />
      <dc:date>2011-09-27T06:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Issues</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292181#M497502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hei &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attach is an example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it uses the interval match function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 10:06:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292181#M497502</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2011-09-27T10:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Expression Issues</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292182#M497503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks liron for ur reply. This solution helps me in getting the correct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saurabh Mudgil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 09:01:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Issues/m-p/292182#M497503</guid>
      <dc:creator />
      <dc:date>2011-09-29T09:01:00Z</dc:date>
    </item>
  </channel>
</rss>

