Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wildmatch code???

Hi all,

I want to change the content of my field based on three conditions:

-if contains '_AB' change to AB,

-if contains '_CD' change to CD,

-others leave as it is.

Where is my error in the following code? Thank you in advance!!!

LOAD

    NAME,

    IF(WILDMATCH(NAME, '*_AB*'),'AB', NAME

    and WildMatch(NAME, '*_CD*'), 'CD', NAME) as NewField

   

FROM [lib://SAMPLE/Mappe1.xlsx]

(ooxml, embedded labels, table is Tabelle1);

best,

Rustam

13 Replies
Not applicable
Author

ok It means your fieldvalue of NAME field having _ at various places...

please post limited load sample data for better understanding..

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Pick(wildMatch(NAME, '*_PC*', '*_AC*') + 1, NAME, 'PC', 'AC') as NewField

or

Pick(wildMatch(NAME, '*_PC', '*_AC') + 1, NAME, 'PC', 'AC') as NewField

(if _PC or _AC only appear at the end of NAME)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Many Many Thanx Jonathan !!!!

It worked.  That is what i have been exactly looking for:)

best,

Rustam

Not applicable
Author

Hi jonathan,

count1.png

I am having the sheet like above. you can see the numbers 51-55,  101-105,  151-155.

I need change those labels to Q1-Q5 as in first graph.

The scripts i am using:

Dimension: IF(match(question_id,'51','52','53','54','55'),question_id)

Measures:

Count({$<subject_id={2},is_correct_answer={1},test_type={course},final_test_status={passed}>}question_id)

Count({$<subject_id={2},is_correct_answer={0},test_type={course},final_test_status={passed}>}question_id)

I used below script but it is not working.

pick(mixMatch(question_id,'51','52','53','54','55'),question_id,'Q51','Q52','Q53','Q54','Q55')

I think this is helpful to understand the issue i am facing.

Thanks,

Pramod