Announcements
You can succeed best and quickest by helping others to succeed. Join the conversation.
cancel
Showing results for
Did you mean:
Partner - Specialist

## If Expression Not Working As Expected

Hello:

I have the following If expression that I'm trying to use as a calculated dimension in a straight table.  What I'm trying to do is if starting in position 4 for the rest of the string if SUBLOB equals 'AAA Shared Tech', then set SUBLOB = BBB, otherwise, starting in position 4 give me the rest of the string.  Here's the If:

=If(mid(SUBLOB, 4) = 'AAA Shared Tech', SUBLOB = 'BBB', mid(SUBLOB, 4))

However, I'm still getting AAA Shared Tech.  Any ideas what I may be doing wrong?  As always, thanks in advance for any and all help and responses.

1 Solution

Accepted Solutions
Partner - Creator III

Hi, what happens when you do this:

=If(mid(SUBLOB, 4) = 'AAA Shared Tech','BBB', mid(SUBLOB, 4))

5 Replies
Partner - Creator III

Hi, what happens when you do this:

=If(mid(SUBLOB, 4) = 'AAA Shared Tech','BBB', mid(SUBLOB, 4))

Partner - Specialist
Author

Hello Niclas:

Thanks for the response.  I still get AAA Shared Tech in the straight table.  It doesn't change to BBB.

MVP

May be this

=If(WildMatch(SUBLOB, '???AAA Shared Tech*'), 'BBB', Mid(SUBLOB, 4))

Partner - Specialist
Author

Hello Niclas:

This is a bit embarrassing, but your solution actually does work and I will mark your response as the correct one.  I had another problem with my If expression in that I was using the wrong starting position for the mid function.  Instead of starting at 4, it should have been 5.    My apologies for any inconvenience.  Thank you for your help.

Partner - Specialist
Author

Hello Sunny:

Please see my latest response to Niclas.  Niclas's solution does indeed work.  Your solution also works.  Thank you for your response.  I appreciate it.

Community Browser