Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

SQL Error:'makedate' is not a recognized built-in funtion name

Hello

I'm loading from an SQL Server something like this: (Date comes as a timestamp)

Date:

SQL SELECT
Date,
year( Date ) as Year,
month( Date ) as Month,
day( Date ) as Day,
MakeDate( Year, Month, Day ) as Date_Short,
week( Date_Short ) as Week,
weekday( Date_Short ) as WeekDay,
Year & '-Q' & Ceil( Month/3 ) as YearQtr,
applymap( 'Quarters_Map', Month, null() ) as Quarter,
Date( monthstart( Date ), 'MMM-YY' ) as YearMonth
FROM table_name;


And when I run it, I get the following error:

SQL Error:[Microsoft][ODBC SQL Server Driver][SQL Server] 'makedate' is not a recognized built-in funtion name



What's the matter?!?!?

Tags (3)
1 Reply
Not applicable

SQL Error:'makedate' is not a recognized built-in funtion name

Hi,

In fact, the code write after the SQL SELECT instruction is executed in the source language
That is to say in your SQL server database, so you have to have the SQL Server syntax.

If you want to use QlikView Syntax, you must use a LOAD without FROM clause before the SQL SELECT

the easier way to do it is to use the wizard : Go in the Script section, add use the option "preceding load". Then select data again in your database.

You will see two level :

Load

Field 1
Field2
...

;

SQL select

Field1
Field 2

FROM Dbo.tablename.

The Script will first execute the SQL Select instruction (so you can use the SQL Server SQL syntax here). Then the Load Statement will be executed and you will be able to use QlikView functions upon field loaded in SQL Select.

Hope it helps

Regards

Community Browser