Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm stuck on a seemingly easy task. I load data from a table with a date column and want to filter the data to only load records from a specific year.
I've been trying alot of different variants as candidates for the WHERE clause, all with different errors.
start_time is the name of the column that hold the date.
LOAD ....
SQL SELECT
...
FROM "fact_table"
WHERE Year('2014-01-01')=Year(Date(start_time));
SQL##f - SqlState: 42883, ErrorCode: 7, ErrorMsg: ERROR: function year(unknown) does not exist;
let start_date=MakeDate(2014, 01, 01);
...
WHERE Year($(start_date))=Year(start_time);
ErrorCode: 7, ErrorMsg: ERROR: function year(integer) does not exist;
What am I doing wrong here?
Your database server doesn't understand qlikview functions like Year. If you use Postgresql then you can try the Extract function.
Your database server doesn't understand qlikview functions like Year. If you use Postgresql then you can try the Extract function.
That makes sense.
I'm using postgresql and the following did the trick.
WHERE start_time >= '2014-01-01' AND start_time < '2015-01-01';
Thanks!
have you tried to execute directly the sql request on the database ?