Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

surynnchin
New Contributor III

Exclude in script

NoStoreProductAProductBProductCProductDProductEAmount
1StoreAAAAAA99
2StoreAAFFFF2000
3StoreAADDDD300
4StoreAEEEVJ4000
5StoreAETCCU800
6StoreABBBBB999

Hi Community,

I want to exclude row1 and row 6, how should i put it in my script?

LOAD No,

          Store,

          ProductA,

          ProductB,

          ProductC,

          ProductD,

          ProductE,

          Amount

From Excel

where not ProductA=ProductB=ProductC=ProductD= ProductE;

Tags (3)
1 Solution

Accepted Solutions
surynnchin
New Contributor III

Re: Exclude in script

Thanks everyone for your help.

I put like this:

DATA:

LOAD No,

     Store,

     ProductA,

     ProductB,

     ProductC,

     ProductD,

     ProductE,

     Amount

FROM DataSource

WHERE not ((ProductA=ProductB) and (ProductB=ProductC) and (ProductC=ProductD)and (ProductD=ProductE));

6 Replies

Re: Exclude in script

Hi,

     Try this.

DATA:

LOAD No,

     Store,

     ProductA,

     ProductB,

     ProductC,

     ProductD,

     ProductE,

     Amount,

     If((ProductA=ProductB) and (ProductB=ProductC) and (ProductC=ProductD)and (ProductD=ProductE)  ,1,0) as Flag

FROM

C:\Users\Kaushik\Desktop\Book1.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Data:

Load No,

     Store,

     ProductA,

     ProductB,

     ProductC,

     ProductD,

     ProductE,

     Amount

Resident DATA where Flag=0;  

Drop table DATA; 

Regards,

Kaushik Solanki

Not applicable

Re: Exclude in script

Hi,

I would do sth like:

WHERE replace(ProductA & productB, PorductC, ProductD, productE, productA, '') <> ''

The advantage is that you can add a field very easily.

Fabrice

MVP
MVP

Re: Exclude in script

HI,

Try like this

DATA:

LOAD No,

     Store,

     ProductA,

     ProductB,

     ProductC,

     ProductD,

     ProductE,

     Amount

FROM DataSource

WHERE (ProductA=ProductB) and (ProductB=ProductC) and (ProductC=ProductD)and (ProductD=ProductE);

Hope this helps you.

Regads,

Jagan.

surynnchin
New Contributor III

Re: Exclude in script

Thanks everyone for your help.

I put like this:

DATA:

LOAD No,

     Store,

     ProductA,

     ProductB,

     ProductC,

     ProductD,

     ProductE,

     Amount

FROM DataSource

WHERE not ((ProductA=ProductB) and (ProductB=ProductC) and (ProductC=ProductD)and (ProductD=ProductE));

MVP
MVP

Re: Exclude in script

Hi,

Missed Not in my where condition, Good Catch.  Anyway close this disucssion.

Regards,

Jagan.

nihhalmca
Valued Contributor II

Re: Exclude in script

Hi SurynnChin,

Try this

 

LOAD

No

Store

ProductA

ProductB

ProductC

ProductD

ProductE

Amount

FROM Excel file

Where not No=1 and 6;


Community Browser