Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mslottje
Contributor II

Exclude value in loading script

Hi guys,

I have a script where I load all of my credits.

There is one specific credit note that has to be excluded.

I tried to do this by using the following expression in my script:

Credit:

LOAD

     No_ as [Item],

    "Sell-to Customer No_" as [Sell-to-Customer],

    "Document No_" as [Invoice Number]

FROM ["our database".qvd]

(qvd)

WHERE([Invoice Number] <> 'Credit-1234')

That didn't work. Would be great if you guys could help me outSmiley Happy

Mike

1 Solution

Accepted Solutions
vinieme12
Esteemed Contributor II

Re: Exclude value in loading script

Try wit match()

Where match(Document No_,'credit-1234')=0:

8 Replies
vinieme12
Esteemed Contributor II

Re: Exclude value in loading script

Try wit match()

Where match(Document No_,'credit-1234')=0:

jayaseelan
Contributor III

Re: Exclude value in loading script

Hi Mike,

Try the following script.

Credit:

LOAD

     No_ as [Item],

    "Sell-to Customer No_" as [Sell-to-Customer],

    "Document No_" as [Invoice Number]

FROM ["our database".qvd]

(qvd)

WHERE NOT WILDMATCH(invoicenumber,'*credit-1234*');

THANKS

sravanthialuval
Contributor

Re: Exclude value in loading script

Hi,

Aliases which will you created in the table, we can't  able to reuse in the same table.

Try this below code using original field name in where condition.

Credit:

LOAD

     No_ as [Item],

    "Sell-to Customer No_" as [Sell-to-Customer],

    "Document No_" as [Invoice Number]

FROM ["our database".qvd]

(qvd)

WHERE  "Document No_" <> 'Credit-1234' ;

mayuresh_d
Contributor

Re: Exclude value in loading script

hi,

it is best to use match as invoice number has text data type  . hence use following script

Credit:

LOAD

     No_ as Item,

    "Sell-to Customer No_" as Sell-to-Customer,

    "Document No_" as Invoice_Number

FROM ["our database".qvd]

(qvd)

WHERE NOT MATCH(Invoice_Number,'*Credit-1234*');

ogster1974
Honored Contributor II

Re: Exclude value in loading script

Credit:

LOAD

     No_ as [Item],

    "Sell-to Customer No_" as [Sell-to-Customer],

    "Document No_" as [Invoice Number]

FROM ["our database".qvd]

(qvd)

WHERE NOT MATCH([Document No_], 'Credit-1234')

mslottje
Contributor II

Re: Exclude value in loading script

That works!Smiley Happy

mslottje
Contributor II

Re: Exclude value in loading script

That is also working! Unfortunately I can't give two answers the correct button..

Thanks Andy and Sravanthi!

rahulpawarb
Valued Contributor III

Re: Exclude value in loading script

Hello Mike,

I agree with Sravanthi! Use Field Name in WHERE criteria i.e. WHERE  [Document No_] <> 'Credit-1234' ;

Regards!

Rahul