Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
ruben_moya
Creator
Creator

Exclude data between two dates in qvd in script

Dear experts,

I have a set of data multiple attributes including create_date and start_date.

During the next year, i have to limit the data 

From all the registers, I have filter those ones that either started or where created after 01-03-2019 BUT I have to EXCLUDE those that were created and started in between 20200301 and 20210301.

Is there a way to EXCLUDE a range of dates?

What I need is something like this:

load *

FROM [lib://XXXXXXXX.qvd] (qvd)

where (create_date >= '2019301' or start_date >= '20190301') and ''EXCLUDE''

(create_date >= '2020301' and start_date < '20210301')

 

Thanks in advance

Labels (1)
2 Solutions

Accepted Solutions
barnabyd
Partner - Creator II
Partner - Creator II

G'day @ruben_moya,

I think what you're asking for is this ...

where (create_date >= '20190301' or start_date >= '20190301')
  and not (create_date >= '20200301' and start_date < '20210301')

Cheers, Barnaby.

 

 

Barnaby Dunn
BI Consultant

View solution in original post

ali_hijazi
Partner - Master
Partner - Master

I think you mean by EXCLUDE -> NOT
so your where condition would be :
and NOT (create_date >= '2020301' and start_date < '20210301')

I can walk on water when it freezes

View solution in original post

5 Replies
ali_hijazi
Partner - Master
Partner - Master

you already wrote the condition
but you need to make sure that the dates in the QVD file are of the same format that you are using in the where condition
if they are the same then you need to remove the single quotes from the values you are supplying in the where condition

I can walk on water when it freezes
ruben_moya
Creator
Creator
Author

Hi @ali_hijazi 

thanks for the answer, but i need the Excluding part. There is no such an 'exclude' function as far as I know.

barnabyd
Partner - Creator II
Partner - Creator II

G'day @ruben_moya,

I think what you're asking for is this ...

where (create_date >= '20190301' or start_date >= '20190301')
  and not (create_date >= '20200301' and start_date < '20210301')

Cheers, Barnaby.

 

 

Barnaby Dunn
BI Consultant
ali_hijazi
Partner - Master
Partner - Master

I think you mean by EXCLUDE -> NOT
so your where condition would be :
and NOT (create_date >= '2020301' and start_date < '20210301')

I can walk on water when it freezes
ruben_moya
Creator
Creator
Author

Really? was it that simple? that's awkward... 

Thanks a lot guys!