Assuming you have a source dataset with a structure similar to this:
TableName | LoadFlag |
---|---|
Table 1 | 0 |
Table 2 | 1 |
To pivot the rows into columns, you can use a Mapping Data Flow :
- Add a Source Transformation:
- Add a source dataset that points to the table containing the
TableName
andLoadFlag
columns.
- Add a source dataset that points to the table containing the
- Add a Pivot Transformation:
- In the Data Flow, add a Pivot Transformation.
- Set the "Pivot key" to
TableName
. - Set the "Pivoted column" to
LoadFlag
. - For the "Aggregate function," you can use
max()
ormin()
to ensure that the column values are correctly aggregated.
Table 1 | Table 2 |
---|---|
0 | 1 |
After transforming your data, use a Lookup Activity to query the pivoted table to check the values of Table1
, Table2
...
- Use an If Condition:
- Use an If Condition Activity in the pipeline after the Lookup to evaluate whether the
LoadFlag
for a particular table is 0 or 1. - Example Expression:
@equals(activity('LookupActivityName').output.firstRow.Table1, 1)
- Use an If Condition Activity in the pipeline after the Lookup to evaluate whether the
- Set Up Pipeline Execution Based on Condition:
- If the condition evaluates to
true
, proceed to load the table. - If
false
, skip the loading process.
- If the condition evaluates to