Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

where clause Question

I am trying to load all rows besides the first 2 in below table. my code is under, it is not working. any clue?  

DateFile name
1/17/2015abc
1/17/2015def
1/17/2015ghj
3/21/2015abc
3/21/2015def
3/21/2015ghj
4/12/2016abc
4/12/2016def
4/12/2016ghj

From [one.qvd](qvd)

where  ([Date] <> '1/17/2016' and [File name] <> 'abc')

or  ([Date] <> '1/17/2016' and [File name] <> 'def');

I also tried: but no success

where not  ([Date] = '1/17/2016' and [File name] = 'abc')

or  ([Date] = '1/17/2016' and [File name] = 'def');

1 Solution

Accepted Solutions
sunny_talwar

This seems to be working:

Table:

LOAD * INLINE [

    Date, File name

    1/17/2015, abc

    1/17/2015, def

    1/17/2015, ghj

    3/21/2015, abc

    3/21/2015, def

    3/21/2015, ghj

    4/12/2016, abc

    4/12/2016, def

    4/12/2016, ghj

]

Where not (Date = MakeDate(2015, 1, 17) and Match([File name], 'abc', 'def'));

View solution in original post

6 Replies
sunny_talwar

This seems to be working:

Table:

LOAD * INLINE [

    Date, File name

    1/17/2015, abc

    1/17/2015, def

    1/17/2015, ghj

    3/21/2015, abc

    3/21/2015, def

    3/21/2015, ghj

    4/12/2016, abc

    4/12/2016, def

    4/12/2016, ghj

]

Where not (Date = MakeDate(2015, 1, 17) and Match([File name], 'abc', 'def'));

Anonymous
Not applicable
Author

Sunny, you never miss your target. it worked like a charm. Thank you so much. however I have some questions which I will post later.

sunny_talwar

Sounds like a plan

Anonymous
Not applicable
Author

I tried without the make date :>>>>>>>>>

where Not ([Date] = '1/17/2016' and Match([File name], 'abc', 'def')); This works.

But this one should also work logic wise:  where ([Date] <> '1/17/2016' and File name <> 'abc')

or ([Date] <> '1/17/2016' and File name <> 'def');any idea why this is not working. In my sample app, it did not load any data for 1/17/2016.

sunny_talwar

I think ands and ors are off... try this:

Where ([Date] <> '1/17/2016' or File name <> 'abc') and ([Date] <> '1/17/2016' or File name <> 'def');

or

Where ([Date] <> '1/17/2016' or (File name <> 'abc' and File name <> 'def'));

Anonymous
Not applicable
Author

both of your codes worked. Thank you. I need to reassess my logic.