Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
I have the data field "Rule". This includes f.e. ((user.userId="user1" or user.userId="user2")). In form of a table, it looks like this:
ID | Rule |
123456 | ((user.userId="user1" or user.userId="user2")) |
999999 | (user.userId="user1" or user.userId="user6")) |
My goal is to split these users and write each in a separate line. It should look like this:
ID | UserID |
123456 | user1 |
123456 | user2 |
999999 | user1 |
999999 | user6 |
Is there somebody who can help me?
Thanks in advance.
Hi
Using the subfield without the third parameter gives you the result what you want
LOAD
ID,
Rule,
textbetween(SubField(Rule,' or '),'"','"') as RuleSplit
INLINE [
ID, Rule
123456, '((user.userId="user1" or user.userId="user2"))'
999999, '(user.userId="user1" or user.userId="user6"))'
];
and then with the textbetween() function you can cleanup the string.
hope it helps.
kind regards
Hi
Using the subfield without the third parameter gives you the result what you want
LOAD
ID,
Rule,
textbetween(SubField(Rule,' or '),'"','"') as RuleSplit
INLINE [
ID, Rule
123456, '((user.userId="user1" or user.userId="user2"))'
999999, '(user.userId="user1" or user.userId="user6"))'
];
and then with the textbetween() function you can cleanup the string.
hope it helps.
kind regards
Thats it.
Thank you very much. 🙂