Alteryx Designer Desktop Discussions

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

How to delete a row when the Condition is not satisfied

Sadi44
5 - Atom

I am new to Alteryx and struggling to find answer for deleting a row if the condition is not met and the condition should be checked only for specified values in the below conditions and after checking the condition the data set should include all other values for those condition is not applied and should also include the values that satisfy the mentioned condition only. I will be grateful if anyone helps me on this.

These are the conditions and I have attached the dataset

  • 115 prediction should be less than -4200
  • 213 prediction less than -700
  • 126 prediction should be between -400 to -700

Thanks in Advance

6 REPLIES 6
Ladarthure
14 - Magnetar
14 - Magnetar

Hi,

 

to filter rows, you can use filters, in your case, you might want to use the custom filter in which you can type a formule to filter the rows needed.

 

What I did is creating a filter when one of the condition is met, it's going to keep the row, else it will delete the row as shown below :

([ID] = '115' and [Value] <= -4200) or
([ID] = '213' and [Value] <= -700) or
([ID] = '126' and [Value] <= -400 and [Value] >-700)

 

The problem with this method is that you might need to have many different cases based on ID.

 

I hope it helps

Emmanuel_G
13 - Pulsar

@Sadi44 

 

In attachement one way of doing that.

 

Let me know if it works and please do not hesitate to mark this answer as solution if it worked.

 

Emmanuel_G_0-1664356712791.png

 

Sadi44
5 - Atom

@Emmanuel_G

Thank you for your reply but that is not the output I want, can you please try like this, it should include other ID values also. It should delete the model id that are not satisfied by those conditions and even other ID's model id values should also be deleted if the three conditions are not met

Sadi44
5 - Atom

@Ladarthure

Thank you for your reply, but that is not the output I want. Can you please try like this, if the three conditions are not satisfied then the model id's for other ID's should also be eliminated and remaining model ids should be included for whatever id the conditions are satisfied

Emmanuel_G
13 - Pulsar

@Sadi44 

 

What I suggest is to add a status column that defines whether or not the 3 conditions are met (Last column on the right in the screenshot).

 

So you will keep all the lines. You can then filter or not if you want based on this column.

 

Is it ok for you ?

 

Emmanuel_G_0-1664362676456.png

 

Sadi44
5 - Atom

@Emmanuel_G

Thank you for you reply, but in the formula tool you are using boolean or it gives value if any one of the condition is satisfied but I want the output with all the three conditions to be satisfied at once. And later it should include include model id's for those id's which are being satisfied by these three conditions with the id's 115,213,126 along with other id's with model id's that are being satisfied by those conditions 

Labels