Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

tomdabek
New Contributor III

Excluding Rows on Load with WHERE AND

Hi, New user to Qlikview and trying to exclude certain rows with my load statement:

LOAD    

   ..........

FROM [$(vPath)\*.xlsx]

(ooxml, embedded labels, table is QLIK)

WHERE NOT WildMatch ([Plant Number] , '10844', '10846') 

OR (NOT [Plant Number] = '20531' AND [Material Number] = 'AG6604');

The 1st part works, any entry in the data where [Plant Number] is 10844 or 10846 is excluded

However, all records for [Plant Number] 20531 are excluded when I only want the ones where the [Material Number] is AG6604 excluded

I have tried a few combinations but am unable to figure out how to exclude loading a row using a rule that includes two (or more)  of the columns in the criteria.

Thank You

1 Solution

Accepted Solutions

Re: Excluding Rows on Load with WHERE AND

Try this:

WHERE NOT WildMatch ([Plant Number] , '10844', '10846')

OR ( [Plant Number] <> '20531' AND [Material Number] <> 'AG6604');


talk is cheap, supply exceeds demand
2 Replies

Re: Excluding Rows on Load with WHERE AND

Try this:

WHERE NOT WildMatch ([Plant Number] , '10844', '10846')

OR ( [Plant Number] <> '20531' AND [Material Number] <> 'AG6604');


talk is cheap, supply exceeds demand
tomdabek
New Contributor III

Re: Excluding Rows on Load with WHERE AND

Thank You,

I must have misrepresented my original question, but your solution is correct except I changed the "OR" to "AND" to apply the filter to both situations I am trying to prevent from loading.

WHERE NOT WildMatch ([Plant Number] , '10844', '10846')

OR   AND  ( [Plant Number] <> '20531' AND [Material Number] <> 'AG6604');

Community Browser