<?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 Trying to create flag based on muliple load statements and criteria in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-create-flag-based-on-muliple-load-statements-and/m-p/1186941#M627431</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to create a flag in my load statement but the flag has some complex logic. Here is some pseudo code on what I am attempting to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE:&lt;/P&gt;&lt;P&gt;LOAD LOG_ID, IN_TIME, OUT_TIME, EMP_ID, ServDate, Location&lt;/P&gt;&lt;P&gt;FROM Case.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SERV:&lt;/P&gt;&lt;P&gt;LOAD EMP_ID, SERVICE&lt;/P&gt;&lt;P&gt;FROM Serv.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BLOCK:&lt;/P&gt;&lt;P&gt;LOAD SERVICE, DayOfWeek, WeekNum, StartDate, EndDate, StartTime, EndTime,BlockLoc&lt;/P&gt;&lt;P&gt;FROM Block.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAL:&lt;/P&gt;&lt;P&gt;created calendar table with different date element to tie together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create one final table using some join statements to create a flag. Flag logic needs to be like the following:&lt;/P&gt;&lt;P&gt;if CASE.ServDate between BLOCK.StartDate and BLOCK.EndDate&lt;/P&gt;&lt;P&gt;and CASE.IN_TIME between BLOCK.StartTime and BLOCK.EndTime&lt;/P&gt;&lt;P&gt;and CASE.Location = BLOCK.BlockLoc&lt;/P&gt;&lt;P&gt;and WeekDay(CASE.ServDate) = BLOCK.DayOfWeek&lt;/P&gt;&lt;P&gt;and CAL.WeekNum = BLOCK.WeekNum&lt;/P&gt;&lt;P&gt;THEN 1 ELSE 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried doing some joins to create a staging table with the elements needed, then build the if logic on the staging table but I can't seem to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any suggestions on the best way to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2016 19:13:52 GMT</pubDate>
    <dc:creator>andrewmo</dc:creator>
    <dc:date>2016-09-16T19:13:52Z</dc:date>
    <item>
      <title>Trying to create flag based on muliple load statements and criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-create-flag-based-on-muliple-load-statements-and/m-p/1186941#M627431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to create a flag in my load statement but the flag has some complex logic. Here is some pseudo code on what I am attempting to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE:&lt;/P&gt;&lt;P&gt;LOAD LOG_ID, IN_TIME, OUT_TIME, EMP_ID, ServDate, Location&lt;/P&gt;&lt;P&gt;FROM Case.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SERV:&lt;/P&gt;&lt;P&gt;LOAD EMP_ID, SERVICE&lt;/P&gt;&lt;P&gt;FROM Serv.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BLOCK:&lt;/P&gt;&lt;P&gt;LOAD SERVICE, DayOfWeek, WeekNum, StartDate, EndDate, StartTime, EndTime,BlockLoc&lt;/P&gt;&lt;P&gt;FROM Block.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAL:&lt;/P&gt;&lt;P&gt;created calendar table with different date element to tie together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create one final table using some join statements to create a flag. Flag logic needs to be like the following:&lt;/P&gt;&lt;P&gt;if CASE.ServDate between BLOCK.StartDate and BLOCK.EndDate&lt;/P&gt;&lt;P&gt;and CASE.IN_TIME between BLOCK.StartTime and BLOCK.EndTime&lt;/P&gt;&lt;P&gt;and CASE.Location = BLOCK.BlockLoc&lt;/P&gt;&lt;P&gt;and WeekDay(CASE.ServDate) = BLOCK.DayOfWeek&lt;/P&gt;&lt;P&gt;and CAL.WeekNum = BLOCK.WeekNum&lt;/P&gt;&lt;P&gt;THEN 1 ELSE 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried doing some joins to create a staging table with the elements needed, then build the if logic on the staging table but I can't seem to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any suggestions on the best way to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 19:13:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-create-flag-based-on-muliple-load-statements-and/m-p/1186941#M627431</guid>
      <dc:creator>andrewmo</dc:creator>
      <dc:date>2016-09-16T19:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create flag based on muliple load statements and criteria</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-create-flag-based-on-muliple-load-statements-and/m-p/1186942#M627432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you are on the right track.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to create a qvw with the data mocked up using Inline tables I would be glad to look at it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know what you think,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 19:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-create-flag-based-on-muliple-load-statements-and/m-p/1186942#M627432</guid>
      <dc:creator />
      <dc:date>2016-09-16T19:47:40Z</dc:date>
    </item>
  </channel>
</rss>

