 In one of our videos, we talked about how we can use the group by function to aggregate and summarize our data without having to use the pivot table. So the same thing the group by function does, we can also use the pivot by function to do it and again with more flexibility. In the sense that when you want to see the salary paid across the different departments and by different work type. So with group by function, your result is going to be arranged in vertical arrangement. It's going to be arranged vertically, but with pivot by function, you can add more flexibility to it. There it is, you can decide what you want on the vertical row and what should be on the horizontal arrangement. Now let's see how we can use group by function to do this then before we now use the pivot by function to add more flexibility to it. So here I'm going to say the group by function, the group by, now our row field, what do I want on the row. So I want my departments and I also want my work type. Then the values, values is talking about which field do I want to aggregate. So I want to aggregate my salary field and the function. Function is what kind of aggregation do you want to do on the salary. So I can sum, I can add, I can do the account, I can find the average, the standard deviation, anything you want to do. You want to do the percentage, anyone can work. So here I'm only going to do the sum and close the bracket and hit enter. Right, easily now we can see the department and also we can also see the work type. This table is a little big. So what if we want to reduce the size of this table? By putting our department in vertical element, why the work type should be what should be horizontally. So this is when we need to use the pivot by function. Now let's state pivot by function and see how it works today. Now pivot by function has its first argument as the row field. So which field should be on the row. Now it should be my department or my department on the row. Now column field is an additional argument which we do not have on the group by function. So we can specify what should be on the column. I want the work type. The values is what field do I want to aggregate. I'm aggregating my salary and the function is talking about what kind of aggregation do you want to do on it. So I want to aggregate it using the sum function as well. Then I'll close the bracket. All other arguments are optional. Now easily now we now have our department in row and our work type in column. So this is how you use the pivot by function to summarize your data. And we add flexibility to it, facelift to have it in row and to have it in column. In fact I can use it for the row. I want to depart two rows there. I don't want the business units. You can specify the business units and departments. Right. We enter what increases this but then this is now instilling your row. So this is how you can use pivot by function to add flexibility to your report. And we have all other optional arguments as well. So to see them we've explained how all other optional arguments works in our group by function video. So look for it and you see an example of how you can use them. Thank you.