6 Replies Latest reply: Feb 3, 2015 8:09 AM by Sunny Talwar

# help with Wildcard and Getfieldselections

Hi all,

Hope you can help

I have created a chart but it doesn't seem to work properly.

Here are the 2 expressions:

1.

If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0,\$(vMI_Calc_ND%) * 100,null())

2.

If(WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') > 0,\$(vMI_Calc_RelND%) * 100,null())

Everytime I click select "Rel ND", it brings up the "ND" on the chart so it shows both lines. I cannot take the asterix out before the 1st expression because there are also other selections before it.

I can see the problem but not sure how to rectify this.

Can anyone help?

Thanks

• ###### Re: help with Wildcard and Getfieldselections

Hi

You either need a more stringent search term for the first expression, or you can exclude *Rel ND. Like this:

If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0

AND WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') = 0

,\$(vMI_Calc_ND%) * 100,null())

HTH

Jonathan

• ###### Re: help with Wildcard and Getfieldselections

The behaviour you describe is correct, I think you have to exclude from the first expression the possibility to find REL ND so you can write

If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0 and

WildMatch(GetFieldSelections(Name,',',50),'Rel ND (#%)*') = 0

,\$(vMI_Calc_ND%) * 100,null())

let me know

• ###### Re: help with Wildcard and Getfieldselections

Hi,

I would need to have the ability to compare both ND and Rel ND so I would need both of the checked as well one or the other.

• ###### Re: help with Wildcard and Getfieldselections

Are these expressions either or? Meaning either you want to see expression 1 or expression 2 at one given point of time? or is it just that the first expression is picking up values where Name selection is Rel ND?

If later is the problem then I would try a statement like this for the 1st expression:

If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0 and WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') = 0,

\$(vMI_Calc_ND%) * 100,null())

Or you can use nested if:

If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0, If(WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') = 0,

\$(vMI_Calc_ND%) * 100, null()), null())

Hope this helps

Best,

S

• ###### Re: help with Wildcard and Getfieldselections

Hi,

I would need to have the ability to compare both ND and Rel ND so I would need both of the checked as well one or the other.

• ###### Re: help with Wildcard and Getfieldselections

You can then have three expressions

1) If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0 and WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') = 0, \$(vMI_Calc_ND%) * 100,null())

2) If(WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') > 0,\$(vMI_Calc_RelND%) * 100,null())

3) If(WildMatch(GetFieldSelections(Name,',',50),'*Rel ND (#%)*') > 0,\$(vMI_Calc_RelND%) * 100, If(WildMatch(GetFieldSelections(Name,',',50),'*ND (#%)*') > 0,\$(vMI_Calc_ND%) * 100, null()))

Your third expression is "either or" expression I mentioned before. First if will check if its a wild match with *Rel ND (#%), if not then it will move to check it with *ND (#%). If it matches neither, then it will give a null().

I hope this will be helpful.

Best,

S