on 08-15-2018 4:51 PM
I need to crate a variable on the base of a string which has dynamic values.
This string has various values that I want to indicate with some identifier.
Suppose I have value "afdfa2324 MMA 7897acncn" that I want to identify as "MMA" and I have a value "A2M3" that I want to show as "Mark". The pattern remains (AlphaNumericAlphaNumeric) the same but value changes. I can get the value for the first one using If statement but since the Values are changing for the second one I don't know what formula to use.
appreciate your help. Thanks
Hi Bashir,
Does the workaround help?
Thanks,
Mahboob Mohammed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bashir,
I quickly created some sample data, and also the variables required to address your requirement. (A = Alpha, N=Numeric)
1st Char AN Flag =If(IsError(ToNumber(Substr([String];1;1)))) Then "A" Else "N"
2nd Char AN Flag =If(IsError(ToNumber(Substr([String];2;1)))) Then "A" Else "N"
3rd Char AN Flag =If(IsError(ToNumber(Substr([String];3;1)))) Then "A" Else "N"
4th Char AN Flag =If(IsError(ToNumber(Substr([String];4;1)))) Then "A" Else "N"
Finally, a Group variable with below formula
=If(Match([String];"*MMA*")) Then "MMA"
ElseIf([1st Char AN Flag]="A" And [2nd Char AN Flag]="N" And [3rd Char AN Flag]="A" And [4th Char AN Flag]="N") Then "Mark" Else "Others"
Voila, here is how the result looks like, seems its working. Hope that helps!
Thanks,
Mahboob Mohammed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.