Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Undefined function 'If' in expression

Hi guys,

I have a database I’m extracting information from using the code below

ODBC CONNECT32 TO [MS Access Database;DBQ=H:\General - Shareplan\Ad-hoc\2014\Qlikview - live\Database.mdb];

Milestones:
sql select

MilestoneDefID,
ExpectedDate,
CompletionDate,
If(MilestoneDefID = 9,[ExpectedDate],) as [9 - expected]

FROM [Milestone];

It comes up with this error though.

SQL##f - SqlState: 37000, ErrorCode: 4294964194, ErrorMsg: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'If' in expression.

I suspect it’s because I’m using an IF statement with a SQL select statement but I’ve searched the net and can’t come up with a solution.  Can anyone help?

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

while extracting from database you won't use If statement.

Try this using preceeding load

ODBC CONNECT32 TO [MS Access Database;DBQ=H:\General - Shareplan\Ad-hoc\2014\Qlikview - live\Database.mdb];
Milestones:
Load *,
     If(MilestoneDefID = 9,[ExpectedDate],) as [9 - expected];
sql select

MilestoneDefID,
ExpectedDate,
CompletionDate,

FROM [Milestone];

View solution in original post

3 Replies
Not applicable
Author

Hi,

while extracting from database you won't use If statement.

Try this using preceeding load

ODBC CONNECT32 TO [MS Access Database;DBQ=H:\General - Shareplan\Ad-hoc\2014\Qlikview - live\Database.mdb];
Milestones:
Load *,
     If(MilestoneDefID = 9,[ExpectedDate],) as [9 - expected];
sql select

MilestoneDefID,
ExpectedDate,
CompletionDate,

FROM [Milestone];
Anonymous
Not applicable
Author

Thanks

Not applicable
Author

Welcome 🙂