Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
nigharikkha
Contributor II
Contributor II

SubField() Wildmatch

Hi,

I am using SubField() while loading to get separate rows for a field separated by comma(,).

Ex: Sample data as below. 

Devices |  Slot |  Value

-----------------------------

ABC1,ABC2,ABC3 | 1 | 4345

ABC2 | 3 | 3r545r3

ABC4,ABC7 | 5 | 3435r45

 

Load Script that I am using:

LOAD

SubField(Devices,',') as Device,

Slot,

Value

 

I need to add a condition to this load something like WildMatch(Device,'ABC1','ABC2','ABC3').

Can anyone help how this match condition be applied for a subfield?

Thanks

Labels (1)
2 Solutions

Accepted Solutions
nigharikkha
Contributor II
Contributor II
Author

I got the solution. I used preceding LOAD as below.

LOAD * where WildMatch(Device,'ABC1','ABC2','ABC3');

LOAD 

SubField(Devices,',') as Device,

Slot,

Value

View solution in original post

maxgro
MVP
MVP

You can use a preceding load  


Data:
LOAD * INLINE [
Devices| Slot| Value
ABC1,ABC2,ABC3 | 1 | 4345
ABC2 | 3 | 3r545r3
ABC4,ABC7 | 5 | 3435r45
] (delimiter is '|');

Output:
LOAD
*
WHERE
WildMatch(Device,'ABC1','ABC2','ABC3');
LOAD
SubField(Devices,',') as Device,
Slot,
Value
RESIDENT Data;

Drop table Data;

View solution in original post

6 Replies
saranyadurai
Contributor III
Contributor III

Hi @nigharikkha ,

May be try like this,

LOAD

If(Wildmatch(SubField(Devices,','),'ABC1','ABC2','ABC3'),Your Output,0) as Device,

Slot,

Value

FROM XXX;

Hope this helps!

 

 

PrashantSangle

What is your expected output??

Great dreamer's dreams never fulfilled, they are always transcended.
nigharikkha
Contributor II
Contributor II
Author

@SaraK Hi I tried this but there the function does not allow subfield inside.

nigharikkha
Contributor II
Contributor II
Author

I got the solution. I used preceding LOAD as below.

LOAD * where WildMatch(Device,'ABC1','ABC2','ABC3');

LOAD 

SubField(Devices,',') as Device,

Slot,

Value

maxgro
MVP
MVP

You can use a preceding load  


Data:
LOAD * INLINE [
Devices| Slot| Value
ABC1,ABC2,ABC3 | 1 | 4345
ABC2 | 3 | 3r545r3
ABC4,ABC7 | 5 | 3435r45
] (delimiter is '|');

Output:
LOAD
*
WHERE
WildMatch(Device,'ABC1','ABC2','ABC3');
LOAD
SubField(Devices,',') as Device,
Slot,
Value
RESIDENT Data;

Drop table Data;

nigharikkha
Contributor II
Contributor II
Author

Thanks @maxgro