Good morning,
I have many data sources all coming into Alteryx from excel. The important info for my data always starts on rows 1, 2 or 3 but this changes occasionally. More importantly the information always starts after a record with the word "Cost" or "Price", like so:
Cost | A | B |
123 | 456 | 789 |
or
PRICE | A | B |
545 | 565 | 546 |
Rather than changing a select record tool for each new sheet, is there a tool which could detect the keywords "Cost" or "Price" and filter only for the records after?
Thank you!!
Solved! Go to Solution.
Hi @Csam
Take a look at this approach. I mocked up some more data, where the headers aren't always "Cost" or "Price". All credit to @jdunkerley79 for getting the creative process flowing with his great solution, and thought to create a boolean field for filtering.
The multi-field formula tool takes a couple of passes at each row of data, using the following function:
IF IsEmpty([Field1]) THEN 0
ELSEIF [Field1] in ("Cost","Price") THEN 0
ELSEIF [Row-1:Field1] in ("Cost","Price") THEN 1
ELSEIF [Row-1:FilterMe]=1 THEN 1
ELSE 0
ENDIF
So first, if it's an empty row from your data (here, I've assumed you're unioning the Excel files together), mark it with false. Same if the row contains the words "Cost" or "Price", because those are just headings. Then, if the row above has Cost or Price in the first column, or the FilterMe field in the row before is true, then mark it as true.
Otherwise it must be false. This works for many different headings, and for when there are blank rows separating the data (or there aren't blank rows).
If your empty rows contain spaces, you can replace the first line with Contains([Field1]," ")
Let me know if this helps.
Cheers!
Esther
This is exactly what I was looking for, thank you both for the help!!