Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

I have to select A if other options are there

Sshasnk
8 - Asteroid

I have a dataset and I have to A if B is there in the same account and if B alone is there then I have to keep the B

 

Example:

 

Accountvalue
123A
123B
123A
124A
124A
125B
125B
121B

 

 

Output:

 

Accountvalue
123A
123A
124A
124A
125B
125B
121B

 

So basically, in account 123, with A the B was also coming so I have to remove it but with account 125 and 121 only B was there so kept it.

 

 

 

 

 

 

9 REPLIES 9
Qiu
21 - Polaris
21 - Polaris

@Sshasnk 
Maybe not the best way. 😂

0414-Sshasnk.PNG

martinding
13 - Pulsar

Hi @Sshasnk,

 

Please see attached:

martinding_0-1681442340196.png

 

RobertOdera
13 - Pulsar

Hi, @Sshasnk 

 

Please consider the below.

I hope you find it helpful - Cheers!

 

RobertOdera_0-1681475192523.png

 

Sshasnk
8 - Asteroid

@RobertOdera Your solution is the closest one but still not right. I is failing if in the same account, it has more than one B in account 123

 

Accountvalue
123A
123B
123A
124A
124A
125B
125B
121B
123B

 

 

 

RobertOdera
13 - Pulsar

Hi, @Sshasnk 

 

So, a couple things, please:

1. Improve your explanation of your desired result 

2. Improve the comprehensiveness of your input and desired output sample 

 

It looks like those goal posts are shifting. 

Given the above, we will help you get there, no problem - cheers!

 

 

 

 

 

 

 

Sshasnk
8 - Asteroid

@RobertOdera As I mentioned in my question 

 

1. If I have A and B in the same account replace all the B's and keep all the A's

2. If only A is there keep all of them

3. If only B is there keep all of them.

 

Now in your solution if I have more than one B, In this case rest of B's are still there 

RobertOdera
13 - Pulsar

Hi, @Sshasnk 

 

By "replace all the B's" you mean "exclude all the B's," correct?

Try this...

 

RobertOdera_0-1681584926012.png

 

RobertOdera
13 - Pulsar

😎

 

 

 

Sshasnk
8 - Asteroid

@RobertOdera  Yes, exclude B's

Labels