Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
i want to limit the data load from a odbc-datasource.
select * from my_database where my_type = 42.
my_type is of data type integer.
Unfortunately qlik does not take this condition and loads everything.
what is the right syntax for qlik-sense ?
is there a cast or something necessary ?
thx for your hints!
Just try specifying the value in quotes
select * from my_database where my_type = '42'.
Just try specifying the value in quotes
select * from my_database where my_type = '42'.
If your having trouble the quotes might work or how about to put your SQL in a view and pass that in.
in sql
CREATE VIEW dbo.YourView
AS
select * from my_database where my_type = 42
GO
In your load script
SELECT * FROM dbo.YourView
Id also suggest you name your fields in your select statement so you dont bring in unnecessary data that can cause performance and association issues down the line as your app grows.
Regards
Andy
Most SQL databases accept the ANSI SQL LIMIT clause:
SELECT * FROM customers LIMIT 1000;
Microsoft SQL Server has it's own proprietary TOP clause that has to come immediately after the SELECT like this:
SELECT TOP 500 * FROM customers;
This is much much better to use than the FIRST prefix for LOAD since obviously the former syntax will prevent a lot of data to be extracted and sent to Qlik before it is discarded by the FIRST prefix....
However you can use it for any type of LOAD like this:
FIRST 100 LOAD * FROM mySheet.xlsx (ooxml......);
Thanks for your input!
thanks for your input, using rownum does pretty much the same for me.