Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need help in converting SQL to QlikView

Hi how can i write the below expression in QlikView by loading the data from the excel file or QVD instead of pulling data from SQL server.

CASE WHEN DATEPART(dw, D.Calendar) IN (1,7) THEN 0 ELSE 1 END

thanks in advance.

1 Solution

Accepted Solutions
ramoncova06
Partner - Specialist III
Partner - Specialist III

you could use network days for this but this would do it

if(WeekDay( D.Calendar) = 1 or WeekDay( D.Calendar) = 7, 0, 1)

View solution in original post

2 Replies
rubenmarin

Hi Chinna, you can use WeekDay() to check the day, it may vary, 0 can be Monday or Sunday depending on regional settings, it should be something like:

If(match(weekday(Date), 0, 6), 0, 1) as FieldName

From [xls]...


ramoncova06
Partner - Specialist III
Partner - Specialist III

you could use network days for this but this would do it

if(WeekDay( D.Calendar) = 1 or WeekDay( D.Calendar) = 7, 0, 1)