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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
christianflood
Partner - Contributor II
Partner - Contributor II

WildMatch function

Hi I have a column with strings in it.

The format of the strings are following

1.01.01.02 CAPITAL LETTERS

1.01.01.02-01 First letter capital the rest is lower case

1.01.01.03 CAPITAL LETTERS

1.01.01.02-01 The first letter will be capital again, sometimes there might be a capital within aswell

1.01.02.01 CAPITAL LETTERS SOMETIMES HAS-A DASH


What I want to do is to collect all strings that has capital letters in a new field, same for the others


One way to filter would be that if #-# would exist the save to new field


This if statement is close but won't do because it will map on HAS-A DASH aswell:

If(WildMatch(Field, '*-*') = 1, [Field]) AS [NewField],


I tried this aswell but it doesn't work

If(WildMatch(Field, '*#-#*') = 1, [Field]) AS [NewField],


Is there a way to catch number-number but not letter-letter?


Br

Christian

1 Solution

Accepted Solutions
sunny_talwar

Are you looking for this?

Capture.PNG

May be this:

Table:

LOAD Field,

  If(Len(Trim(KeepChar(Field, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) > 1, Field) as Field1,

  If(Len(Trim(KeepChar(Field, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) < 2, Field) as Field2;

LOAD * Inline [

Field

1.01.01.02 CAPITAL LETTERS

1.01.01.02-01 First letter capital the rest is lower case

1.01.01.03 CAPITAL LETTERS

1.01.01.02-01 The first letter will be capital again, sometimes there might be a capital within aswell

1.01.02.01 CAPITAL LETTERS SOMETIMES HAS-A DASH

];

View solution in original post

2 Replies
sunny_talwar

Are you looking for this?

Capture.PNG

May be this:

Table:

LOAD Field,

  If(Len(Trim(KeepChar(Field, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) > 1, Field) as Field1,

  If(Len(Trim(KeepChar(Field, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) < 2, Field) as Field2;

LOAD * Inline [

Field

1.01.01.02 CAPITAL LETTERS

1.01.01.02-01 First letter capital the rest is lower case

1.01.01.03 CAPITAL LETTERS

1.01.01.02-01 The first letter will be capital again, sometimes there might be a capital within aswell

1.01.02.01 CAPITAL LETTERS SOMETIMES HAS-A DASH

];

christianflood
Partner - Contributor II
Partner - Contributor II
Author

Hi Sunny T,

I got the same result doing it like this:

If(WildMatch([Field],'*-0*','*-1*','*-2*','*-3*','*-4*','*-5*','*-6*','*-7*','*-8*','*-9*') >= 1, [Field]) AS [Field 1],
If(WildMatch([Field],'*-0*','*-1*','*-2*','*-3*','*-4*','*-5*','*-6*','*-7*','*-8*','*-9*') = 0, [Field]) AS [Field2],

But thanks alot for your help!