Hi All,
I am working on a use case where I need to select some columns based on value of one of the column in row.
The sample example shown below:
Reference ID | Name | Indicator | Store1 | Address1 | Store2 | Address2 |
ID1 | A | 1 | StoreX | AddressX | StoreA | AddressX |
ID2 | B | 1 | StoreY | AddressY | StoreB | AddressY |
ID3 | C | 2 | StoreZ | AddressZ | StoreC | AddressZ |
So, when the indicator is 1, I need to take forward columns Reference ID, Name, Store1 and Address1,
and when the indicator is 2, I need to take forward columns Reference ID, Name, Store2 and Address2.
Then I have big business logic to work on these columns.
Is there any simple way to achieve this? Thanks much in advance.
Solved! Go to Solution.
Hi @rachana19,
here is a quick way to do this:
Result:
Workflow attached. Let me know what you think.
Best
Alex
I would use a filter tool to split the data to 2 different streams based on the value of [Indicator], then use a Select tool to select the correct fields for each stream.
You can recombine the streams with a Union Tool, but would have to rename the different fields in each select tool.
Hi Alex,
Thanks a lot for this. This works as expected.
Hi David,
Thanks a lot for this. This works as expected.
Done. Thanks again.