I have a table like below
The main idea is to get the amount of each channel for each orderID
.
If the channel is repeating for Id, it should take the amount only once and rest would be null.
The result should look like below
I want to do the same logic for country and source as well. If I do the pivot it should only give unique amount value for each ID on Channel, Source and Country basis and repeated value should be NULL.I have a very big data set and tough to do it in Excel
How can I do this in SQL Server? Is there any window function? Can anyone please help me?
Thanks in advance