Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
prahlad_infy
Partner - Creator II
Partner - Creator II

what is wrong with where condition of a simple code ?

Hello Sirs ,

I am not understand the wrong with below code . All i want to remove certain rows while loading fro qvd . But where conition not working .

Table1:

LOAD * INLINE [

    A1, B1, C1

    Unkown, QX, 5001

    Unkown, 1A, 5001

    Unkown, 2A, 5001

    AB1, 3A, 5001

    AB2, 4A, 5001

    AB3, 5A, 5001

    AB4, 1A, 5001

    AB5, QX, 5001

    AB6, QX, 5002

    AB7, 1A, 5003

    AB8, 2A, 5004

    AB9, 3A, 5005

    Unkown, 4A, 5006

    Unkown, 5A, 5007

    AB12, 1A, 5008

    AB13, QX, 5009

    AB14, QX, 5010

    AB15, 1A, 5011

    AB16, 2A, 5012

    AB17, 3A, 5013

    AB18, 4A, 5014

    AB19, 5A, 5015

    AB20, 1A, 5016

    AB21, QX, 5017

    Unkown, QX, 5018

    Unkown, 1A, 5019

    AB24, 2A, 5020

    AB25, 3A, 5021

];

STORE Table1 into C:\Users\xxxxxxx\Desktop\xxxxxxx\xxxxxxxxxx\Table1.qvd ;

DROP Table Table1 ;

Table2:

LOAD A1,

     B1,

     C1

FROM

(qvd) Where not WildMatch(A1,'Unkown') or not WildMatch(B1,'QX') ;

Please help sir .

1 Solution

Accepted Solutions
jaumecf23
Creator III
Creator III

Hi,

The last where has an error. Try this one:

Table2:

LOAD A1,

           B1,

           C1

FROM

[Table1.qvd]

(qvd) Where not(WildMatch(A1,'Unkown')) and not(WildMatch(B1,'QX')) ;

View solution in original post

10 Replies
jaumecf23
Creator III
Creator III

Hi,

The last where has an error. Try this one:

Table2:

LOAD A1,

           B1,

           C1

FROM

[Table1.qvd]

(qvd) Where not(WildMatch(A1,'Unkown')) and not(WildMatch(B1,'QX')) ;

trdandamudi
Master II
Master II

One more way you can do this is as below:

Table2:
LOAD A1,
B1,
C1
FROM
(qvd)
Where Not (A1 = 'Unkown' or B1 = 'QX') ;

manoranjan_d
Specialist
Specialist

pls use this and let me know your requirement meeting

Where not WildMatch(A1,'Unkown') and not WildMatch(B1,'QX') ;

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

and not(WildMatch(B1,'QX')) ;


Why and , i want to remove only those rows which have either Unknown is field A1 or QX in Field B1 .



(qvd) Where not(WildMatch(A1,'Unkown')) or not(WildMatch(B1,'QX')) ; --- > This did not work

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

In A1 field we can have Values like UnkownPerson,UnknownID etc , so i needed wildmatch

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

i am really confussed .. can please someone explain ? I know , if might be missing something very silly

jaumecf23
Creator III
Creator III

Because you only want to load that rows that confirms that A1 is not 'Unkown' and B1 is not 'QX'. Remember that you are using the logic in a Negative way.


Imagine that we have the following line:


A1, B1, C1

Unkown, 1A, 5001

OR Logic (A1 is not 'Unkown' or B1 is not 'QX')  : A1 is 0 (denied), B1 is 1 (accepted). 0 or 1 is 1 (line accepted)

AND Logic (A1 is not 'Unkown' and B1 is not 'QX')  : A1 is 0 (denied), B1 is 1 (accepted). 0 and 1 is 0 (line denied)


I expect that this helps to understand the logic.

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

Thank you so much , This helps .

What if i had to delete only those records whose A1=Unknown and B1=QX ? What had been logic ?

manoranjan_d
Specialist
Specialist

once you used filter in the where condition its  "omitted  or deleted" and only retrieve the specific record required