Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Script help

Hi, i am trying to do something in my script but i'm not sure how to do it..

I am loading in a table with the following fields..

PosTransactionDetail:

LOAD

     StoreNumber,

     TransId,

     EANCode AS EAN,

     VATIndicator,

     VATAmountDue,

     VATBase,

     LineType,

     SaleStartDate

FROM...

But i don't want to load in any LineTypes which equal 'V' and any VATBase values less than '0'.

Can anyone help me to achieve this please?

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, Try this.

    

PosTransactionDetail:

LOAD

     StoreNumber,

     TransId,

     EANCode AS EAN,

     VATIndicator,

     VATAmountDue,

     VATBase,

     LineType,

     SaleStartDate

FROM xyz

Where (not wildmatch(LineType,'v') or VATBASE >= 0);

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi Kaushik Solanki,

Thanks for your reply.. i think i have my original question wrong though. It seems that i do actually need some of the line type'v' included...

What i need is to exclude linetype 'v' if they are greater than 0

PosTransactionDetail:

LOAD

     StoreNumber,

     TransId,

     EANCode AS EAN,

     VATIndicator,

     VATAmountDue,

     VATBase,

     LineType,

     SaleStartDate

FROM xyz

Where not wildmatch(LineType,'v') and <0 if that makes sense? So only include linetype v if a negative figure...

How can i write that?

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Can anyone help me on this please?

salezian
Creator
Creator

Try solotuion proposed above. Change only operator to AND instead of OR. It'll exclude all records type V with value greater than 0.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks for your reply.

That doesn't work..

What that is doing is excluding ALL lineTypes of V and all negative VATBase values.

I want it to ONLY exclude positive VATBase values if they have a LineType of V...

Can this be done?

erichshiino
Partner - Master
Partner - Master

Try to change the condition to this:

FROM xyz

where not( wildmatch(LineType,'v') and VATBASE >= 0);

Regards,

erich