Alteryx Designer Desktop Discussions

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

Remove rows based on condition

FECL3
8 - Asteroid

Hi

 

I'm trying to remove rows based on a condition, whereby once it is found i then want to remove that row and then all 4 rows beneath it. I have considered using the multi-field formula tool and then create a flag which can then be filtered out. My issue is I don't know how to configure the multi-field formula tool. 

 

Please see example data below. I want to remove all 3 rows under Total for Year as well as the Total for Year row.

 

Your help would be much appreciated

 

NameValue
Week 110
Week 220
Week 330
Week 440
Week .... 
  
Total for Year 

Sales

500

Cost

400

Profit

100
8 REPLIES 8
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @FECL3,

 

Could you not just use the StartsWith() function?

 

 

StartsWith([Name], 'Week')

 

 

JonathanSherman_0-1639393795371.png

 

 

I've attached my workflow for you to download if needed!

 

Kind regards,

Jonathan

FECL3
8 - Asteroid

No, the above is a sample data so that won't work as there are duplicates fields. A better example of the data format would be this:

 

 Week 1Week 2Week 3Week 4
Sales10101010
Cost5555
Profit5555
     
     
Total for Month 1   
Sales40   
Cost20   
Profit20   

 

 

In effect the table at the bottom is a summary of the detailed table above, but I need to remove it and it's difficult because the naming convention is the same as the above. The only unique identifier is the header, which comes out similar to the "Total for Month"

 

Thanks

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @FECL3,

 

In that case it could be achieved with a multi-row formula and a filter tool:

 

JonathanSherman_0-1639399194464.png

 

 

I've attached my workflow for you to download if needed!

 

Kind regards,

Jonathan

FECL3
8 - Asteroid

Thank you. Although this solution won't work if there are more tables that I need below. I need the solution to be more precise. 

 

I am dynamically inputting in multiple files into one workstream so there is more data below the table.

 

Thanks again

 

mceleavey
17 - Castor
17 - Castor

Hi @FECL3 ,

 

@Jonathan-Sherman 's solution is correct with the data you and scenario you've provided. If you want anything else, you need to provide a representative dataset to cover these scenarios.

Can you please provide a dataset that is representative and covers the issues you're having?

 

M.



Bulien

FECL3
8 - Asteroid

Hi @mceleavey 

 

Please see dataset below.  Please bare in mind that there can be multiple iterations of this as I am dynamically

 

Thanks

 

 Week 1Week 2Week 3Week 4
Sales10101010
Cost5555
Profit5555
     
     
Total for Month 1 - Product 2    
Sales40   
Cost20   
Profit20   
     
     
 Week 1Week 2Week 3Week 4
Sales10101010
Cost5555
Profit5555
     
     
Total for Month 1 - Product 1    
Sales40   
Cost20   
Profit20   
mceleavey
17 - Castor
17 - Castor

@FECL3 ,

 

...and, what do you want to see? That data is a different layout to the previous request.

 

M



Bulien

mceleavey
17 - Castor
17 - Castor

@FECL3 ,

 

I've attached a workflow that will now dynamically pull the data you need and create the following format:

 

mceleavey_0-1639417087675.png

 

This will handle any number of tables. If you're dynamically loading them in though, it sounds like you could do this before smooshing the data together.

 

Anyway,

 

I hope this helps,

 

M.

 



Bulien

Labels