Check if a Column Exists and Add it When Doesn't Exist - azure

In the Azure Data Factory data mapping flow, is there a way to check if a column Date exists in the input file? If true, select the Date column, if not then create a Date column but leave the column blank in the output?
I tried with conditional select that if name=='Date', name the column as Date, but it the workflow fail with the "Date" column doesn't exist.

You can use byName() in the derived column transformation.
This is my sample input data with Date column.
In derived column, use the below dataflow expression.
toDate(byName('Date'))
The above byName() will search for the given column name and if it is there in the columns list then it gives those values and if it not there it will give null values to the column.
Result when Date column present in source:
Source without Date column:
Result with Date column and values as NULL:
After derived column transformation, use select transformation to select your desired columns.

Related

Extract rows from table, into another table, where value in column = external value

I'm looking for a formula that would allow me to extract rows from a table where the value in the first column is equal to a reference?
See the table below:
If the value in the first column is equal to 13:00:00, as it is on the right of the pic, extract the relevant row onto a new table. I have attached the spreadsheet to play with.
https://www.mediafire.com/file/eaz7no3263vl3sd/Table.xlsx/file
Just FILTER the range against the reference value:
https://support.microsoft.com/en-us/office/filter-function-f4f7cb66-82eb-4767-8f7c-4877ad80c759

find value within specific columns of named tables

Im doing a check for the value in C2 in a table (call it M1table), using this part of the formula:
(C$2=M1table)
Whole formula:
=RIGHT(INDEX(M1table,(SUMPRODUCT((C$2=M1table)*ROW(M1table))-ROW(M1table)),20),1)
How do I specify columns instead of checking the whole table? Unfortunately I don't have named columns, is there a way to do it with column number (look for value of C2 in 2nd to 8th column)? If using column names is the only way, I can name them.
Thank you
If M1table is a real Excel table, then the column header is the name and you can reference like M1table[colName]
If M1table is just a range, and not a real table, then you can use the INDEX function to reference a single column. eg: for the 2nd column in the table:
C$2=INDEX(M1table,0,colNumber)
For columns 2-8 you could use:
=$C2=INDEX(M1table,,2):INDEX(M1table,,8)

How to match same values in three columns and display a value of 3rd column into new column using Excel?

I have a excel sheet where I need to match the values of Columns "A","B","C" and return a duplicate value of Column "C" as one value into Column "D" . The similar columns are Team, Month, Value. The fourth column is called "Actual Value" here the matching and repeated value should appear based on Column A.
Excel table:
The formula I tried :
=IF(A3=B3;C:C;"C3")
but this is not giving the Output.
Put this in D3 and copy down:
=IF(OR(A3<>A2,B3<>B2),C3,"")
This assumes your data is sorted on A then B as your example shows.
It test whether the data changes from the line above. If true then it returns the value. If false it returns an empty string.

Excel formula to output name in first column based on a value in the 3rd column

I have a data table with 8 columns and i want to know if anyone can help me come up with a formula to get the name in the first column if i enter a value into the columns (3,4,5,6,7,8).
I want the name from the first column to appear in another table on another sheet where only names appear where data is in the columns (3,4,5,6,7 & 8)
Try this:
=IF(OR(Sheet1!C2<>"";Sheet1!D2<>"";Sheet1!E2<>"";Sheet1!F2<>"";Sheet1!G2<>"";Sheet1!H2<>"");Sheet1!A2;"")
You can use C1 = 1 .... if you prefer.
And C1,D1,E1... have to be replaced with your columns.
Also Sheet1 have to replaced with your sheet name
I would use a Pivot tables.
First create a new column in the existing table:
If you only having positive values then it is:
=sum(C2:H2)
If you have zero and negative values as well it would be like this:
=IF(COUNTBLANK(C2:H2)=6;0;1)
Then make a pivot table with the "TO/TA name" in the Row Labels and the new column in Report filter - where you then removes the "0".

Date range using Advanced Filter

I currently am using an advanced filter to pull data from a master list. I only have one column for the date in the master list. What I want to do is be able to enter a date range (1/1/11 - 1/31/11) and have the filter only pull the month of January out of all of the data.
Is this possible to do when I only have one column to type in my filter arguments?
What you can do is create a calculated column and use that as an additional filter.
For instance in a new column type in
=IIF(MyDate < '2/1/2011 AND MyDate >= '1/1/2011', 1, 0)
Then the value of the cell will either be a 1 or 0. Then just filter your sheet for 1's based on this column.
This solution also requires a new calculated column. If your dates are (for example) in column E, then put this formula in a new column:
=month(E1)
Copy and paste the formula. Now you can filter by month.

Resources