Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've a field that has over 2 k unique email ids.
For the sake of testing, I want to replace email ids with couple of email ids that I have
Ex: emails starting with letters AB,......W should be replace with Jon.doe, emails starting with x...Z to be replaced with jane so on.
I know we can use if condition for implementing the above, I was looking for a function , like the range function in python
Does qlik have a function that can pick a range between alphabets ?
If(eMail precedes 'X', 'Jon.Doe', 'Jane.Doe')
I'm not aware of such a function. However, I am sure it could be possible to construct such a feature.
Maybe a combination of the ord() function in an interval match could be key words pointing you in one doable direction.
another approach is not to do text "intervals" but instead wildchars. Then you could do an wildmatch() function or the qlikview component for wildchar mapping: SUB Qvc.CreateWildMapExpression. https://github.com/RobWunderlich/Qlikview-Components/
@SMalli Could you please give us sample data and I will try to figure some solution for it.
An inline mapping table is easy to maintain and modify in script for testing purposes.
Test_Map:
MAPPING LOAD * INLINE [
Key, Value
A, John
B, John
C, John
D, John
E, Jane
F, Jane
G, Jane
H, Jane
];
Test:
LOAD
ApplyMap('Test_Map', Left(Email, 1), Null()) as JohnJane
FROM
Table.qvd (qvd);
If(eMail precedes 'X', 'Jon.Doe', 'Jane.Doe')
@MarcoWedelI was not thinking of the precedes nor follows operator, but those will surely do the trick 👍
Thank y0u Vegar and Marco !, appreciate the help.