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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

EXCEL import data filtering

Hi, everybody.

I have a QV project with data import from EXCEL via script.

I use the load statement like this and it works fine:

LOAD ....., OBDOBIE, ....

FROM

[source file]

(ooxml, embedded labels)

where OBDOBIE > Date#('1.6.2014','DD.MM.YYYY');

I'd like to improve automation of this statement, because the value for condition > '1.6.2014' I can get from another statement in the same script, connected to a SQL database:

SQL SELECT UZAVRENEOBDOBI

FROM "rsv2_stav".dbo."qryUzavreteObdobie";

This statement works fine too.

I'd like to use the result of Max(UZAVRENEOBDOBI), which is  '1.6.2014 0:00:00', for my load statement.

How can I do this ?

Thanx in advance.

Duski

13 Replies
simenkg
Specialist
Specialist

where Obdobie >= Date#('$(vUzavreneObdobi)','DD.MM.YYYY');

Not applicable
Author

This would return data for 1.6.2014 upwards.

But I need only data for 2.6.2014 upwards.

Duski

simenkg
Specialist
Specialist

Ok.

You are reading the first table twice.

qryUzavreteObdobie:

SQL SELECT UZAVRENEOBDOBI

FROM "rsv2_stav".dbo."qryUzavreteObdobie";

tempMax:

Load max(UZAVRENEOBDOBI) as maxUzavreneObdobi

resident qryUzavreteObdobie;

let vUzavreneObdobi = peek('maxUzavreneObdobi',0,'tempMax');

drop table tempMax;

....

LOAD ...., Obdobie, ....

FROM

[\\hxdata\users\vavra\Hornex\Riadenie\Podpora IS_IT\Koncepcie\Data IS\QlikView\20140704_PP.xlsx]

(ooxml, embedded labels)

where Obdobie > Date#('$(vUzavreneObdobi)','DD.MM.YYYY');

Not applicable
Author

Hi, Simen,

this worked

where Obdobie > Date($(vUzavreneObdobi),'DD.MM.YYYY')

Thank you very much.

Duski