Hi there - i have files which may contain a column. i want to create a formula which checks if it exist. if it does it should delete the column, if it doesnt then it should continue as normal
i am wondering what is the best approach for this
Go to Solution.
Go to Solution.
Hey If you use a Select tool on an instance that has the column in the data, then deselect it in the check box as shown for "Unwanted Col" below, whenever data comes through this select tool it will drop the column if it exists.
Further to Balders's suggestion, another option would be to use the dynamic select tool.
Using the 'select via formula' method and returning a formula that looks something like...
[Name] != "FieldName"
Which will essentially filter out the column with that name. The example configuration is shown in the image.
I have same issue except if the column is missing then it should created the column with null values till rest of columns of that table. Can you please guide?
Ned made a macro for this called Ensure Fields: https://inspiringingenuity.net/2013/08/14/alteryx-ensuring-fields-are-in-a-data-stream/
Thanks. This is solved.
Can we create a new Column in this case. Like wise....
if [Name] != "FieldName" then [NewFiledname] else [FieldName] endif
Hi @dkma, what would that column contains as values ?
The Data would b like. When I Transpose the Data First Column will turn into Row and Columns will be from 1 - 10.. But There in case the numbers from 1 - 11 the Columns would be 1-11.
So. I wanted to check if the columns are 1- 11. if there are no columns from 1 -11 and only from 1-10 , I would like to create a new column 11.
in power query. We can check. the Table.HasColumns([col], TableName) with the use of If condition