1 / 10

Reviewing Group By and Pivot

Learn how to manipulate data using Group By and Pivot functions, split data into groups, and aggregate results. Addressing missing values.

whoffer
Download Presentation

Reviewing Group By and Pivot

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reviewing Group By and Pivot

  2. Manipulating Granularity: Group By Key Data A A 3 3 B B 1 1 C C 4 4 A A 1 1 B B 5 5 C C 9 9 A A 2 2 B B 6 6 C C 5 5

  3. Manipulating Granularity: Group By Key Data A 3 A 3 B B 1 1 C C 4 4 A A 2 1 A 1 B B 5 5 C C 9 9 A 2 B B 6 6 C C 5 5

  4. Manipulating Granularity: Group By Key Data A 3 A 3 B B 1 1 C C 4 4 A A 2 1 A 1 Split into Groups B B 5 5 C C 9 9 A 2 B B 6 6 C C 5 5

  5. Manipulating Granularity: Group By Key Data A B A C B A C 3 18 6 18 6 12 12 A 3 Aggregate Function B B 1 1 C C 4 4 A A 1 2 A 1 Split into Groups Aggregate Function B B 5 5 C C 9 9 A 2 B B 6 6 Aggregate Function C C 5 5

  6. Manipulating Granularity: Group By Key Data A A C B B C A 18 3 12 18 12 6 6 A 3 Aggregate Function B B 1 1 C C 4 4 A A 1 2 A 1 Split into Groups Merge Results Aggregate Function B B 5 5 C C 9 9 A 2 B B 6 6 Aggregate Function C C 5 5

  7. Manipulating Granularity: Pivot KeyR Key C Data A A U U 3 3 B B V V 1 1 C C U U 4 4 A A V V 1 1 B B U U 5 5 C C V V 9 9 A A U U 2 2 B B V V 6 6 D D U U 5 5

  8. Manipulating Granularity: Pivot KeyR Key C Data A U 5 A A U U 3 3 Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function A V 1 B B V V 1 1 A V 1 C U 4 B U 5 B U 5 A V 1 Split into Groups B V 7 B U 5 C V 9 C U 4 C U 4 A A U U 2 2 C V 9 C V 9 B B V V 6 6 D U 5 D U 5 D U 5

  9. Manipulating Granularity: Pivot KeyR Key C Data A U 5 A U 5 A A U U 3 3 A V 1 A V 1 Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function B B V V 1 1 A V 1 B U 5 B U 5 C U 4 B U 5 A V 1 Split into Groups B V 7 B V 7 B U 5 C V 9 C U 4 C U 4 C U 4 A A U U 2 2 C V 9 C V 9 C V 9 B B V V 6 6 D U 5 D U 5 D U 5 D U 5

  10. Manipulating Granularity: Pivot KeyR Key C Data A U 5 A A U U 3 3 A V 1 V Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function Aggregate Function B B V V 1 1 A V 1 U V B U 5 U C U 4 B U 5 1 A A 5 A V 1 Split into Groups 7 B 5 B V 7 V B U 5 C 9 4 C V 9 C U 4 U 5 D C U 4 Need to address missing values A A U U 2 2 C V 9 V C V 9 B B V V 6 6 D U 5 U D U 5 D U 5

More Related