system
December 13, 2011, 2:02pm
1
I have some fields that, for some unknown reason, contains a sales person’s name and a date is appended to the end and there are multiple dates for each sales person. So far no one can tell why or how the dates got in a name field.
My challenge is to create a summary report by sales person. I am using the Match function with If in WebI XI.
Alone these formulas work perfectly. When I attempt to join them I get an error. the error is “Invalid character at position 53 ;”
There will be a lot more sales reps to add but until I can get the first two to work, there is no need adding the rest.
=If(Match([Outside Sales Rep];“Will*”);“Will K”)
=If(Match([Outside Sales Rep];“Jerry*”);“Jerry N”)
It does not like the “;” at the second “if”
I have been away from building reports too long, I guess. I cannot see what is probably very obvious.
=If((Match([Outside Sales Rep];“Will*”);“Will K”);If(Match([Outside Sales Rep];“Jerry*”);“Jerry N”))
So, who would like to shed the light on the obvious for me?
REB01 (BOB member since 2004-11-29)
system
December 13, 2011, 2:18pm
2
This worked for me:
=If(Match([Outside Sales Rep]; “Will*”)) Then “Will K” ElseIf(Match([Outside Sales Rep]; “Jerry*”)) Then “Jerry N”
msr (BOB member since 2008-04-24)
MarkP
December 13, 2011, 2:21pm
3
=If((Match([Outside Sales Rep];“Will*”);“Will K”);If(Match([Outside Sales Rep];“Jerry*”);“Jerry N”))
); before “Will K” should just be ;
Same for before “Jerry N”
When you say dates are appended, would it be easier just to strip the dates from the names?
system
December 13, 2011, 2:22pm
4
Hi,
Use the Nested If condition. The syntax is:
If test_value Then true_value [Else false_value|ElseIf test_value Then true_value [Else
false_value
]]
Ex: =If Match([Outside Sales Rep];“Will*”) Then “Will K” Elseif Match([Outside Sales Rep];“Jerry*” THen “Jerry N” Elseif…
chaitanya_b (BOB member since 2011-11-21)
system
December 13, 2011, 2:24pm
5
I think the extra brackets (highlighted in red) in the first “if” may be causing trouble - remove these…you should also include the “else” bit (in cyan)
=If ( (Match([Outside Sales Rep];“Will*”);“Will K”) ;If(Match([Outside Sales Rep];“Jerry*”);“Jerry N”;“Other”))
mpwalker (BOB member since 2008-11-06)
MarkP
December 13, 2011, 2:30pm
6
You could just strip the numbers - check Marek’s variable part way down this topic:
In WebI I need to find a way to extract the numeric portion of a string. In DeskI, the tonumber(string) function works fine, but it doesn’t in WebI.
For example:
String…Numeric
1…1
2…2
3A…3
3B…3
4…4
4A…4
4B…4
4C…4
…
10A…10
…
100…100
100A…100
100Aa…100
Any ideas? Looks like in WebI, the numeric portion needs to be extracted before tonumber() can convert it. I’m not sure how to get rid of the random characters at the end.
Thanks!
JonTarz (BOB member since 2006-01-09)
system
December 13, 2011, 2:36pm
7
Thanks everyone for your input. I tried each suggestion and finally got this formula to work.
=If(Match([Outside Sales Rep];“Will*”);“Will Keresy”;If(Match([Outside Sales Rep];“Jerry*”);“Jerry Nichols”;[Outside Sales Rep]))
Now, as long as I repeat the process another dozen times, I will be great.
Before I do that, however, I am going to give Marek’s idea a try. Mark, thanks for the lead!
REB01 (BOB member since 2004-11-29)