2 Replies Latest reply: Apr 19, 2012 2:07 AM by Johan Truong RSS

    Show relevant date in regular days

      Goal:

      Display the date in the table if the date is NOT a weekend (satur- and sunday) and NOT holiday in weekdays in the expressen screen.

       

       

      The date system should be based on Norway or Denmark

       

       

      Problem:

      How should I do it?

       

      The table and its data is below and it is based on timestamp.

       

      BeginEnd
      2011-11-10 12:12:122011-11-12 12:12:12
      2011-11-10 12:12:122011-11-11 08:12:12

       

      // JJ

        • Show relevant date in regular days
          Stefan Wühl

          Not sure if I fully understand your requirement or how you want to relate your Begin / End fields the date you want to display.

           

          To check for weekend, you could use weekday() function:

           

          weekday(date)

          Week day. Returns an integer between 0-6.

          Example:

          weekday( '1971-10-30' ) returns 5.

          If the date format used does not correspond to the one set in your operating system, QlikView will not be able to make a correct interpretation. See above under day(date).

           

          I believe you need to load the holidays for your country from an external source, QV does not know any holidays by default. You can join a holiday table to your calendar and then do the check.