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: 
bullish35
Creator II
Creator II

WildMatch expression in Text Object, wrong syntax or not possible?

Hello,

     IF(WildMatch([FieldA], '*Exit*'),

          THEN this expression to create the field to use: ['Text[FieldValue]Text'],

               ELSE this expression to create the field to use: ['Text[FieldValue-1]Text']

The expression I'm using:

 

If

(wildmatch(PRJ_Current, '*Exit*'), 'PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target', 'PRJ_P'&([PRJ_Current Phase ID]-1)&' Phase Entry Date Target')

Thanks in advance!

Ellen

1 Solution

Accepted Solutions
Nicole-Smith

I spoke too soon.  This should work:

If

(PRJ_Current like '*Exit*', $(='[PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target]'), $(='[PRJ_P'&([PRJ_Current Phase ID]-1)&' Phase Entry Date Target]'))

View solution in original post

9 Replies
Nicole-Smith

Try:

If

(PRJ_Current like '*Exit*', 'PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target', 'PRJ_P'&([PRJ_Current Phase ID]-1)&' Phase Entry Date Target')

bullish35
Creator II
Creator II
Author

Getting close!

This returns the text value: "PRJ_P1 Phase Entry Target". However, this is actually the name of a field, [PRJ_P1 Phase Entry Target], and I want the field value to be presented vs. the name of the field in text. I tried bracketing the whole THEN and ELSE statements, but that doesn't seem to work.

This is what I had last:

If

(PRJ_Current like '*Exit*', ['PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target'], ['PRJ_P'&([PRJ_Current Phase ID]-1)&' Phase Entry Date Target'])

Thank you Nicole!

Nicole-Smith

I'm thinking that dollar sign expansion needs to be used here somehow.  I will need to play around with it some to get it to work.

Nicole-Smith

I spoke too soon.  This should work:

If

(PRJ_Current like '*Exit*', $(='[PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target]'), $(='[PRJ_P'&([PRJ_Current Phase ID]-1)&' Phase Entry Date Target]'))

shree909
Partner - Specialist II
Partner - Specialist II

Hi,

can u try like this.

If

(PRJ_Current like '*Exit*',    ' ['PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target']',

                                                   '['PRJ_P'&([PRJ_Current Phase ID]-1)&' Phase Entry Date Target']')

may be its not underatand  the code for condition ---' ['PRJ_P'&[PRJ_Current Phase ID]&' Phase Exit Date Target']',--

can u try that expression in text box, if that works create a variable  and assign to it...

sebastiandperei
Specialist
Specialist

Hi Ellen.

In a Text Box, you need to aggregate or filter the fields you are using.

If the field FieldA has more than one value (I think this is true), the WildMatch function "doesn't know" which one get to return the result.

If you want to show in a Text Box if there is a string in any value of a field, you coud use:

If ( Count ({<FieldA={"*Exit*"}>} FieldA) >1, 'Yes, the field has Exit string', 'No, the field hasn't Exit string')

It will work in a TextBox

bullish35
Creator II
Creator II
Author

That did it! Thank you so much.

bullish35
Creator II
Creator II
Author

Thank you Sebastian. The field only has one value but thank you for your responding!

bullish35
Creator II
Creator II
Author

Thank you for responding!