Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple: Problem loading data on LOAD

Hi guys,
Far as I understand we can't use result as function to filter searching at expression on table chart.
On the expression I have code as follow:

if(([Date("Leave From Date")] - [Date("System Date")]) < 3,[Day("System Date")])

Then how do I use this code above on LOAD database?
If I type in with this code below give me "Error in expression: If takes 2-3 parameters"

if((Date("Leave From Date") - Date("System Date")) < '3') as SystemDate,

Basically, we want to load data from database only showing employee taken day starting leave must 3 days advanced before system date.

"System Date" = From System Time and Date present
"Leave From Date" = Employee submitted leave request starting day/FROM
"Leave To Date" = Employee submitted leave request until day/TO

Much appreciated anyone can help.

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

The syntax for an IF statement is if(expression, value if true, value if false)... the expression and value if true are required, however the value if false is optional.

To correct line from your load statement, add a value if true like this...

if((Date("Leave From Date") - Date("System Date")) < '3', "System Date") as SystemDate,


View solution in original post

2 Replies
Not applicable
Author

The syntax for an IF statement is if(expression, value if true, value if false)... the expression and value if true are required, however the value if false is optional.

To correct line from your load statement, add a value if true like this...

if((Date("Leave From Date") - Date("System Date")) < '3', "System Date") as SystemDate,


Not applicable
Author

Fantastic, thanks it solved!