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: 
pnn44794
Partner - Specialist
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
niclaz79
Partner - Creator III
Partner - Creator III

Hi, what happens when you do this:

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

View solution in original post

5 Replies
niclaz79
Partner - Creator III
Partner - Creator III

Hi, what happens when you do this:

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

pnn44794
Partner - Specialist
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.

sunny_talwar

May be this

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

pnn44794
Partner - Specialist
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.

pnn44794
Partner - Specialist
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.