 Hello, welcome to SS Winitech, so we'll decide and today we are going to see new branch transformation in Azure Data Factory. So what is new branch transformation? Add a new branch to do multiple set of operations and transformations against the same data string. Adding a new branch is useful when you want to use the same source to form multiple strings or for self-joining data together. Next, a new branch can be added from the transformation list similar to other transformation. New branch will only be available as an action when there is an existing transformation following the transformation you are attempting to branch. So what it means that we will see in the practical don't worry. The new branch transformation is very useful because for example, if we want to use the same source multiple times, so we are not going to go directly and get the data from the source. We can create the multiple copies of that data so we can utilize the same. So in our scenario, let me go in the browser and we'll see. So here we have this sales data. So what we want to do? We want to load this file from the input folder to output folder. In the second file, we want to keep only two columns like country and the value. So we want to see the country wise total sales. So country and then sum of this value. So we have to perform this aggregate transformation there. So how we can do that without going to reach twice in the source? So go to on the Azure data factory. Let me try to add a new data flow here and all this data flow as data flow new branch transformation. Now, let me click on this add source and here as I have already created the data set for this. So let me try to select this. Let me try to open this so we can verify here it is pointing to input folder of the sales.csv file the same location that we were seeing in the Azure Blob Storage. Now, here first let me try to load that directly into the sync that is the output folder of the Blob Storage. So here let me try to use the inline query instead of the data set. So here let me use the delimited text. We have to select the link service. So we can select the link service here go to the settings. Here we are required to select the folder path. So folder path is the output folder. Now, if we can scroll down side first row as header which is we want to keep that and here the file name option we can select the output to single file. Now the file name will be the sales dot csv go to the optimize instead of the use current partition we have to use the single partition we have selected output to a single file go to the data preview and try to refresh so we can verify the data here. So here we can see all this data. Now the second we are required to use the aggregate transformation to get the country wise total same. So here we have two ways the first way we can add the source again and getting the data directly from the source. So this is not the better way we can use the new branch transformation. So how we can use that so for that we have to go here and here we can see new branch transformation now. So the second point that we have seen in the slide if we have already selected the transformation or the sync location here then only we can see the new branch that we can see here. So let me click on this new branch. So it is going to create the copy of this over here. Now let me try to do everything that you want to do by using this plus symbol. So here we are required to use the aggregate transformation. So we can select the aggregate and under this aggregate transformation we can get the total sale by country. So here group by under this group by we want to do only for the country. Now in the aggregation here we want to do the aggregation on the value and under this expression we are required to do the sum. So let me use the sum and the numeric value which should be coming from the value. So here it is reflecting an error because the data type that we can see which is the ABC which is string data type. So that's why we are seeing this error. Let me go and try to save and finish. Let me go in the source side. Here go to the projection. Here we can see the option for detect data type or we can directly change the data type of this value as an double or the float. So let me use the float here. Now let me go in the aggregate transformation. So here we can verify. Now this should not have the error that is gone. Now let me try to put this output into the sink. So we can add the sink here but before that let me try to see the data preview here. So it should be having only two columns with the country and the value and the value column will be having the sum of the values that we can see India, US and UK and the total sale for these countries. Go to the sink and here let me use the inline query again. So inline dataset will be having the delimited text. So we can select that one. Then the link service we can select. Go to the setting. Here the folder path by which we want to keep the file so output folder. Let me click on OK. Here we can see the first row as header. Now the output should be in a single file. Now here we can call this sale by country. Everything is OK. We can publish this. So it is having an error because we did not selected the option for the single partition. So let me go back to here and here we can set single partition. Now let me try to publish this. In between let me try to create a new pipeline to execute this. So the data flow will be executed. Let me use the data flow transformation. Publish is completed. So let me go in the setting and try to select the data flow that we have created. Let me try to debug it. So once it will be executed, your output folder will have two files. One for the sales.csv and second for the sale by country by csv. Let me go in the blob stories. Let me go into the output folder and here we can see the last two files. Let me try to open this sales.csv first. So this file will be having all the data that we have seen in the source. Let me go in the edit and here let me click on this preview. So it is holding all the data. Now let me close this and go in the second file which is the sales by country and here let me go in the edit. Then let me preview this. So we can see like India, US and UK. So this is all about the new branch transformation. So as per the performance this is good because we are not going to reach source again. We are just getting the data from this source that we are using. So thank you so much for watching this video. See you in the next video.