2 Replies Latest reply: Feb 16, 2018 1:06 AM by Jinghua Ji RSS

    Same date value, different weekday values

    Jinghua Ji

      Hi all,

       

      i recently came across with a problem within Qlik sense.

      with the script below, i got 2 different weekday returned

       

      SET FirstWeekDay=6;

       

      LET vQVD_TS = '15/02/2018';
      LET vQVD_TS1 = DATE(TODAY()-1);

       

      LET vDAY=NUM(WEEKDAY($(vQVD_TS)))&'.'&WEEKDAY($(vQVD_TS)); //6.Sat
      LET vDAY1=NUM(WEEKDAY(TODAY()-1))&'.'&WEEKDAY(TODAY()-1); //4.Thu
      LET vDAY2=NUM(WEEKDAY($(vQVD_TS1)))&'.'&WEEKDAY($(vQVD_TS1)); //6.Sat
      LET vDAY3=NUM(WEEKDAY('15/02/2018'))&'.'&WEEKDAY('15/02/2018'); //4.Thu

       

       

      i tried all sorts of date convertion, nothing woked. It seems to me that if a date value is in variable, weekday will not wok properly

      i wonder if it is a bug or i was doing something wrong here.

      Hope someone can shed some light for me.

      thanks in advance.