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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pls check this script (WildMatch)

Hi ,

In my QlikView file Edit Script, i am writting below script, but it is generating a problem.

1.) I am creating a variable i.e; If i am giving vA=Hai, then it is generating data based on "Where vA=Hai".

2.) If i am giving vA=Hai,Hello. That means it should get data only for Where A= Hai,Hello , but it is not showing any value.

(Pls Check the WHERE CONDITION in below script)

TestABC:

//LOAD * Inline
//[A,B,C
//Hai,11,xyz
//Hello,12,STU];
//STORE TestABC into TestABC.qvd;


LOAD A,
     B,
     C
FROM
TestABC.qvd
(qvd) Where If('$(vA)'=1,WildMatch(A,'*'), WildMatch(A,'$(vA)'));

Pls can anyone check this.

Thanks  in advance.

Regards

Venkat

Labels (1)
4 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

try this code

TestABC:
LOAD * Inline
[A,B,C
Hai,11,xyz
Hello,12,STU];

Set vA="'Hai','Hello'";

Test:
LOAD A,
     B,
     C,
     1 As Temp
resident
TestABC
Where WildMatch(A,$(vA))>0;

Drop Table TestABC

Not applicable
Author

hi liron,

Thanks for your reply,

I tried what you posted script, its working .

BUT WHEN I AM TRYING like in below script, then it is not showing any Data.

Pls check this.

TestABC:
LOAD A,
     B,
     C
FROM
TestABC.qvd
(qvd);

//Set vA=1;
Set vA="Hai,Hello";

Test:
LOAD A,
     B,
     C,
     1 As Temp
resident TestABC
Where  If('$(vA)'=1,WildMatch(A,'*'), WildMatch(A,'$(vA)')>0); 

Drop Table TestABC;

Regards

Venkat

lironbaram
Partner - Master III
Partner - Master III

hei

i suggest you'll use another varaible

like in the attach script

because what you have in vA is actualy an aaray of values

TestABC:
LOAD * Inline
[A,B,C
Hai,11,xyz
Hello,12,STU];

Set vA="'Hai','Hello'";

Let vB=1;

Test:
LOAD A,
     B,
     C,
     1 As Temp
resident
TestABC
Where if ($(vB)=1,WildMatch(A,'*'), WildMatch(A,$(vA)));

Drop Table TestABC

kaushiknsolanki
MVP
MVP

Hi,

   Try this.

   

let abc =1;

set data="'abc','pqr'";

  

Data:

LOAD * INLINE [

    F1

    abc

    pqr

    30

    40

    50

    60

    70

    80

    90

    100

];

Data1:

Load F1 as D

Resident Data

where if($(abc) =1,WildMatch(F1,$(data)),WildMatch(F1,'*'));

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!