Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have written this as part of a SQL statement after a preceding load:
SQL SELECT *
FROM table1 RS INNER JOIN table2 PS
ON RS.BUILDING_CODE=PS.BUILDING_CODE where date>=from_date and date<=to_date and
((WeekDay(date)=0 and "day_of_week_1_flag" = 'y') or (WeekDay(date)=1 and "day_of_week_2_flag" = 'y'))
I am getting an error that says WeekDay not a recognized built in function. It works in a Load statement, and as a sanity check I checked SQL online; it's a recognized SQL command, as well.
Am I doing something wrong? Any insight is appreciated!
WeekDay is a Qlik function, if you want to use weekday use in Qlik section of the load
load
weekday(date),
......
where
(weekday(date) = ... and ...) or (...)
;
sql select *
FROM table1 RS INNER JOIN table2 PS
ON RS.BUILDING_CODE=PS.BUILDING_CODE where date>=from_date and date<=to_date
;
or if you have sql server as db, use datepart in the sql section of the statement
load *;
sql select *
FROM table1 RS INNER JOIN table2 PS
ON RS.BUILDING_CODE=PS.BUILDING_CODE where date>=from_date and date<=to_date
and DATEPART ( dw , date ) = .......
;
WeekDay is a Qlik function, if you want to use weekday use in Qlik section of the load
load
weekday(date),
......
where
(weekday(date) = ... and ...) or (...)
;
sql select *
FROM table1 RS INNER JOIN table2 PS
ON RS.BUILDING_CODE=PS.BUILDING_CODE where date>=from_date and date<=to_date
;
or if you have sql server as db, use datepart in the sql section of the statement
load *;
sql select *
FROM table1 RS INNER JOIN table2 PS
ON RS.BUILDING_CODE=PS.BUILDING_CODE where date>=from_date and date<=to_date
and DATEPART ( dw , date ) = .......
;
Thank you so much!! I got this via email and didn't even read the second half. The first half of your response appears to have gotten the view to do precisely what I wanted it to do.
Thank you again!