<?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 Calculating Weekend vs. NonWeekend Stay in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247143#M94130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how about something like this &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(weekday(air_travel_date)+1+itin_trip_days&amp;gt;=6,1,0) AS HAS_WEEKEND&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2011 18:49:52 GMT</pubDate>
    <dc:creator>danielrozental</dc:creator>
    <dc:date>2011-08-03T18:49:52Z</dc:date>
    <item>
      <title>Calculating Weekend vs. NonWeekend Stay</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247142#M94129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to calculate the number of air itineraries where an air traveler has a weekend stay included and when an air traveler does not have a weekend stay included.&amp;nbsp; The data I have is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Air intinerary (Field: air_itin)&lt;/P&gt;&lt;P&gt;Air travel date (Field: air_travel_date)&lt;/P&gt;&lt;P&gt;No. of days traveling (Field: itin_trip_days)&lt;/P&gt;&lt;P&gt;Day of week with 1=Sun and 7 = Saturday (Field: DayofWeek.Weekday)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do the following:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Calcuate the full date range of trip by using: (air_itin) to (air_itin + itin_trip_days)&lt;/P&gt;&lt;P&gt;2. Apply the Day of Week to this date range&lt;/P&gt;&lt;P&gt;3. Flag as Weekend stay if range includes a 6 or 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 17:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247142#M94129</guid>
      <dc:creator />
      <dc:date>2011-08-03T17:59:24Z</dc:date>
    </item>
    <item>
      <title>Calculating Weekend vs. NonWeekend Stay</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247143#M94130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how about something like this &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(weekday(air_travel_date)+1+itin_trip_days&amp;gt;=6,1,0) AS HAS_WEEKEND&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 18:49:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247143#M94130</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2011-08-03T18:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Weekend vs. NonWeekend Stay</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247144#M94131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the input.&amp;nbsp; If I was to link to the each air itinerary in the data set, would I have to run this in my script as a partial reload?&amp;nbsp; Is there any special syntax I need to use aside from the if function if so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, I'm happy to just calculate the number of hotel itineraries that have a weekend stay, but in trying to input the formula am getting an error in the expression.&amp;nbsp; This is what I have as the formula currently:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Count(&lt;/P&gt;&lt;P&gt;if((weekday([air_travel_dt])+1+[itin_trip_days])&amp;gt;5),&lt;/P&gt;&lt;P&gt;[HOTEL.hot_itin]) &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;If there is a manual or resource with examples for different types of functions, I'd love to download a copy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Kelly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 19:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247144#M94131</guid>
      <dc:creator />
      <dc:date>2011-08-03T19:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Weekend vs. NonWeekend Stay</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247145#M94132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have a couple misplaced ")"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Count(&lt;BR /&gt;if((weekday([air_travel_dt])+1+[itin_trip_days]&amp;gt;5,&lt;BR /&gt;[HOTEL.hot_itin]))&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, this doesn't need to be included in the load, you could do this as an expression in a chart. Although it might be preferable performance wise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 19:32:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Weekend-vs-NonWeekend-Stay/m-p/247145#M94132</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2011-08-03T19:32:47Z</dc:date>
    </item>
  </channel>
</rss>

