Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am currently creating a report that shows employees who applied leave late (at least 3 days before the actual leave day). I used a pivot table with expression of (LateLeaveApp < 3).
I would like to know how i can add sql condition statement under where clause to load only records that the difference between "Leave From Date" and "System Date" is less than 3.
Next, is it possible to hide my expression column under the pivot table?
[My Qlikview Report]
LOAD "Employee No_",
date("Leave From Date"),
date("Leave To Date"),
"Leave Type",
"Reason for Application",
Date("Leave From Date") - Date("System Date") as LateLeaveApp,
Year("System Date"),
"Entry Type",
date("System Date");
SQL SELECT "Employee No_",
"Leave From Date",
"Leave To Date",
"Leave Type",
"Entry Type",
"Reason for Application",
"System Date"
FROM ENSURE.dbo."Ensure Engineering (Live)$Leave Application"
where ("Employee No_" Between '2' and '5999') AND "Entry Type" = 0;
Thanks for your kind guidance.
Assuming you are using SQL Server it would be something like...
where DATEDIFF(dd, "Leave From Date", "System Date") < 3
Documentation on syntax of datediff can be found here... http://msdn.microsoft.com/en-us/library/aa258269(SQL.80).aspx
Assuming you are using SQL Server it would be something like...
where DATEDIFF(dd, "Leave From Date", "System Date") < 3
Documentation on syntax of datediff can be found here... http://msdn.microsoft.com/en-us/library/aa258269(SQL.80).aspx