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

Error loading data

Hi,

I did this script to load data from MySQL and I have a problem. The table has records from part of 2015 and 2016, but I only want to load the 2016 records.

The field created_at is a timestamp and did not do the filter that I desire:

SalesLine:

LOAD created_at as CreatedatSalesLine,

order_id,

'PV' & right('00000000'&order_id,8) as SalesId,

if(IsNull(product_id),code,product_id)as ItemId,

//code as ItemId,

price,

gift,

quantity_in_order,

quantity_purchased,

quantity_delivered,

1+(ApplyMap('Tax_Item_Map',product_id)/100)as Tax,

(price/1+(ApplyMap('Tax_Item_Map',product_id)/100))as Import_Brut,

ApplyMap('Date_Invoice_Map',order_id)as Date_Invoice;

SQL SELECT created_at ,order_id, product_id ,price, gift,quantity_in_order,quantity_purchased,quantity_delivered,code FROM ulaoffice.NS_order_lines

where floor(created_at)>42369;

Many thank's for your help

Eduard

1 Solution

Accepted Solutions
maxgro
MVP
MVP

in the sql part (ie after SQL)


SQL SELECT created_at ,order_id, product_id ,price, gift,quantity_in_order,quantity_purchased,quantity_delivered,code FROM ulaoffice.NS_order_lines

where floor(created_at)>42369;

you must use the sql syntax of your dbms, mysql; I think you have to change this

where floor(created_at)>42369;


maybe with a

where year(created_at)>= 2016;


View solution in original post

3 Replies
maxgro
MVP
MVP

in the sql part (ie after SQL)


SQL SELECT created_at ,order_id, product_id ,price, gift,quantity_in_order,quantity_purchased,quantity_delivered,code FROM ulaoffice.NS_order_lines

where floor(created_at)>42369;

you must use the sql syntax of your dbms, mysql; I think you have to change this

where floor(created_at)>42369;


maybe with a

where year(created_at)>= 2016;


Peter_Cammaert
Partner - Champion III
Partner - Champion III

or maybe:

:

WHERE created_at >= '2016-01-01';

ecabanas
Creator II
Creator II
Author

Manyyy thank's Maxgro