Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Sebastian_Dec
Creator II
Creator II

Load dates greater than - "where" query

Hi, I'm connecting to a data warehouse and I want to limit date to e.g. a specific year or a few days back.
What might the "where" query look like? 

Data format from warehouse is 'DD-MM-YYYY'

My code dont work 😞

LIB CONNECT TO 'HD (kp)';

Let vEndDate = text(date((Today()-7), 'DD-MM-YYYY'));

[SALES]:
LOAD
hid_shop,
date(hid_data) as data,
kod_gencode,
hid_seg;

SELECT
"hid_shop",
"hid_data",
"kod_gencode",
"hid_seg"
FROM "public"."SALES"
Where "hid_data" >= '$(vEndDate)'
;

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Labels (2)
3 Replies
BrunPierre
Partner - Master II
Partner - Master II

Try without the textual representation.

Let vEndDate = Date(Today()-7, 'DD-MM-YYYY');

Sebastian_Dec
Creator II
Creator II
Author

I have error:

code:

 

LIB CONNECT TO 'HD (kp)';

Let vEndDate = Date(Today()-7, 'DD-MM-YYYY');

[obroty_72]:
LOAD
hid_sklep,
date(hid_data) as data,
kod_ean,
hid_segment;

SELECT
"hid_sklep",
"hid_data",
"kod_ean",
"hid_segment"
FROM "public"."obroty_72"
Where "hid_data" >= '$(vEndDate)'
;

 

error:

 

Started loading data
Connected
The following error occurred:
Field 'hid_sklep' not found
The error occurred here:
SELECT
"hid_sklep",
"hid_data",
"kod_ean",
"hid_segment"
FROM "public"."obroty_72"
Where "hid_data" >= '14-04-2023'
Data has not been loaded. Please correct the error and try loading again.

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
BrunPierre
Partner - Master II
Partner - Master II

Try referring to the fields in uppercase.

Alternatively, you can troubleshoot by just executing the SQL part (without the preceding load) and examining table values from the table viewer.