Hi All,
I would like to apply a filter column header in 2 senses.
1. if the data has column header F7 that contains "PFBNKG", I would like to filter it to true
2. If the data has header F7 but does not contains "PFBNKG", then this will fall on the false side.
See below for instance data set
If the data F7 contains the PFBNKG, it should proceed to the true part and continue processing the results. The False part will stop processing. First row will the header name.
If the data F7 does not contain the PFBNKG, it should proceed to the false part and will remove column F7 since it is no longer needed. The True part will stop processing and the False part will proceed processing. The first row will take the header name.
Thanks and hoping to hear from anyone.
Kamen
Solved! Go to Solution.
Just to better understand the question, can you tell us:
1. Is F7 a fixed column name?
2. is it just that this column is sometimes present and sometimes missing?
Use Filter tool
Filter Tool (alteryx.com)
String operators use the equals to function, it divide the input into two parts , one has the matching condition and another has not matching condition tables
I'm assuming there's more data underneath that shouldn't be affected. Are the 2 lots of processing the same, just without F7 on one side?
If they are the same apart from F7 column, then just use a dynamic rename to take the first row as header and then use a select with "*Unknown" not selected, so if it is something other than "PFBNKG" then it will be dropped. Selecting/deselecting that option at the bottom of the field lists for "Unknown/Dynamic..." is awesome for consistency.
If you do need to split the data first and it's just this row, try a filter with the condition
[Daily Activity Summary]=="Grouping" && [F7]=="PFBNKG"
If you need to split the data before renaming and there is more data under that first row, then you need to find that cell first. A brute force method would be:
- Sample: First 1 row
- Select: F7
- Append Fields: (To append this one cell onto your entire data)
- Filter: Filter the data on that appended field to go either the True or False route.
1. Yes, F7 is a fixed column name but might contains different data since if the column I mentioned is missing, the data moves from left to right. That is why there is a specific name I am looking for in column 7 that is needed to push to processing.
2. You are correct, the column I am looking for with the correct data is sometimes present and sometimes missing. If missing, it will proceed to False and process.
Let me know if you have questions.
Kamen
Then all you need to do is add an empty text input with header F7 and no data. union it to your data, so that you always have F7 coming to your filter. Now you can place a permanent filter without worrying about whether your data has F7 column or not, because that blank F7 text input will place a blank F7 if your data is missing it.
Refer the snip below
Thanks for the response. When I filtered the "PFBNKG", since I have 4 records, the other 3 records went to False section of the filter tool. I need the False section to have no data so that when the data has no "PFBNKG", then all records will go to the False section and the True section will be zero. Will you able to do this?
Looking forward for your assistance.
Kamen
So what you really want to do is, if your data contains PFBNKG in F7 column (irrespective of which row) everything should come out of True and when it is missing, whole data comes out of False?
In the above flow, after filter put a count records tool, append it back to your data, now you can filter over this count. It can come out of true if value is >0 else from false.
This way you will be able to pull out the whole data from true or false.