 Hello welcome to SSUNITECH social decide and today we are going to see about the unpivot transformation. So in the last video of this video series we have seen about the pivot transformation. So if you haven't watched the last video of this video series so I would strongly recommend to watch that video before going forward. So let's get started with unpivot transformation. So use unpivot in a mapping data flow as a way to turn an unnormalized data set into more normalized version by expanding values from multiple columns into a single record into the multiple records with the same value in a single column. So what does it mean? So it means we will be going to have the multiple columns will be going to pick the column names from there and we will be keeping those into a single column. So this is the rotation of the table we could say. So this is the reverse of the pivot transformation. So go to on the source and we will try to understand. So this is our source and here it is having the employee ID month then it is having the day of week like Friday, Monday, Thursday, Tuesday and Wednesday. So what we want to do we want to having the employee ID and month name as it is in the output but all these day of week will be in a single column and the values will be Friday, Monday, Thursday, Tuesday and Wednesday. And we will be having one more column that will be expenses. So those expenses column will be keeping the numeric values that we can see under that. So go to the Azure Data Factory and we will try to implement this in practical. So here let me try to add a new data flow. So we can click on this new data flow here and after that here we are required to add the source. So let me try to close this first. Now let me call this data flow as unbiode. So we can call this as unbiode transformation. Now here we can see the add source. So we can click on that and we are required to add the source here. So either we can add the source from the data set or we can use the inline query. So I am going to use the inline query and this is the delimited text. So we can select that one. So now we need to select the link service. So here is the link service we can select now go to the source option and under the source option we can browse and select the file. So the file which is under the input folder. So here is the file we can select and click on OK. Now we can scroll a little bit down side and the first row as header we can select. Go to the projection and try to import the schema. So this is we have to done because we are using the inline query. If you are going to use the data set directly then it will be imported automatically. So here we can see the employee ID month then the Friday, Monday, Thursday, Tuesday all these values are solved. So that looks good. Now we can go in the data preview and we will try to refresh it. So here we can see the data. Now we can add the unpivot transformation by clicking on this plus symbol and here we can see under this schema modifier the unpivot. So under this unpivot transformation it has three options. The first option that we could see ungroup by. So under the ungroup by we are not required to do anything on the first two columns that employee ID and the month. So we can go and try to select these two columns first. So that is the employee ID and the second column that is the month. So we can select that. Now we can go in the unpivot key. So this unpivot key will be going to have the column which will be keeping the values for these columns. So that will be day of week. So we can call this as day of week and the data type that should be string. So we can select that one. After that under the option we can pick column names as value or the inter values manually. So I am going to choose the first option. Go to the unpivot columns. So under the unpivot column it will be the column that is the expenses. So we can call the expenses in the column names directly and then we can select the data type. So this is the only thing that we need to do. Now we can go under the data preview and here we can see the problem with. So we can close this go back to here and here we can go in the unpivot column and the expenses that should not be integer it should be sort. So we can select the sort and go to the data preview and try to refresh it. Because in the source we have seen the Friday, Monday all those values in the sort. So that is why we have to choose the same data type. So here we can see the value as we were expecting. So we can add the string here and we will be going to load the data into the string. So we can add the string directly and after that we can go here and choose the inline query. So here we want to keep this as delimited text file. So we can select that one go to the settings and before settings we need to select the link service. So we need to select the link service go to the settings now and here we have to specify the container name and the folder path. So we can go under the output folder of this and then we can choose that folder. Now here we can see the first row as header that is okay. Then the file name option so that should be output to a single file and the name of that file will be unpivot data temp we can call. Now we can go under the optimize and instead of use current partition we need to go with the single partition option. We can go in the data preview and try to refresh it now. So we should be able to see the data here so that we can see that. We can publish this so we can click on this publish and here let me publish it. So this will be going to publish. Now we can go under the pipeline and we will try to add a new pipeline and this pipeline will be going to execute the unpivot data flow. So for that we are required to use the data flow transformation here and after that we can go in the settings and we need to select the data flow. So the data flow that we have created the unpivot this one. Now everything looks okay. Now we can click on this debug. So after execution of this data flow one file should be in the output folder with the unpivoted data so go to the output and here as of now I cannot see the unpivot data file here so we can refresh it. So now we can see the unpivot data temp file because your pipeline is executed successfully. So we can refresh and we can check the output status of this. That we can see this is succeed. Now we can go here and this is loading. So go to the edit now and under the edit we could see all the data that we can see like employee ID month day off week and expenses. So all data are here. So this is all about the unpivot transformation. So thank you so much for watching this video. If you have any doubt then you can comment your questions in the comment box. See you in the next video.