I have the following data:
The issue is that there is no year column in this dataset, which I want to add manually so that I can I graph the data. To do so I need to normalize the data and to have only 3 columns for each value (sales, costs, unitssold).
In the end I would like something like this:
What is the best way to go about cleaning the data to more like the bottom graph?
Thank you!
Item_ID | 2010_Sales | 2010_Costs | 2010_UnitsSold | 2011_Sales | 2011_Costs | 2011_UnitsSold | 2012_Sales | 2012_Costs | 2012_UnitsSold | 2013_Sales | 2013_Costs | 2013_UnitsSold | 2014_Sales | 2014_Costs | 2014_UnitsSold | 2015_Sales | 2015_Costs | 2015_UnitsSold |
41988098 | 448 | 689 | 410 | 505 | 761 | 821 | 822 | 689 | 871 | 597 | 837 | 625 | 795 | 159 | 688 | 760 | 541 | 440 |
85479389 | 930 | 930 | 967 | 732 | 951 | 429 | 764 | 340 | 304 | 272 | 540 | 424 | 285 | 298 | 626 | 718 | 158 | 740 |
63981760 | 785 | 366 | 874 | 569 | 818 | 347 | 462 | 775 | 759 | 415 | 302 | 294 | 134 | 232 | 395 | 194 | 708 | 683 |
46774076 | 452 | 526 | 387 | 885 | 220 | 470 | 248 | 563 | 767 | 851 | 120 | 490 | 947 | 622 | 874 | 742 | 554 | 352 |
68727776 | 500 | 821 | 204 | 675 | 817 | 296 | 214 | 929 | 136 | 545 | 604 | 413 | 147 | 283 | 917 | 710 | 109 | 718 |
13199311 | 805 | 219 | 830 | 587 | 452 | 731 | 674 | 972 | 375 | 612 | 142 | 979 | 442 | 595 | 662 | 981 | 218 | 563 |
7026817 | 971 | 983 | 368 | 636 | 644 | 978 | 357 | 486 | 376 | 101 | 387 | 276 | 636 | 307 | 744 | 389 | 705 | 251 |
68650619 | 460 | 344 | 428 | 397 | 196 | 594 | 407 | 490 | 564 | 872 | 260 | 217 | 393 | 276 | 530 | 532 | 804 | 197 |
91968456 | 541 | 389 | 423 | 786 | 824 | 153 | 419 | 311 | 856 | 445 | 710 | 855 | 691 | 928 | 770 | 730 | 994 | 875 |
6295037 | 269 | 475 | 463 | 537 | 154 | 621 | 997 | 410 | 730 | 315 | 948 | 577 | 503 | 706 | 150 | 389 | 220 | 509 |
99957946 | 144 | 213 | 319 | 928 | 631 | 881 | 227 | 757 | 758 | 674 | 770 | 779 | 484 | 234 | 711 | 766 | 592 | 363 |
38507206 | 766 | 697 | 888 | 344 | 176 | 289 | 342 | 819 | 753 | 341 | 119 | 289 | 969 | 744 | 795 | 998 | 282 | 891 |
20902921 | 256 | 981 | 942 | 836 | 311 | 981 | 772 | 840 | 161 | 591 | 562 | 376 | 102 | 896 | 355 | 844 | 766 | 386 |
93167988 | 109 | 388 | 970 | 720 | 259 | 220 | 855 | 748 | 300 | 392 | 814 | 801 | 670 | 637 | 677 | 197 | 368 | 981 |
43881861 | 662 | 819 | 156 | 627 | 649 | 877 | 143 | 986 | 498 | 983 | 304 | 365 | 378 | 634 | 167 | 622 | 492 | 323 |
97293992 | 237 | 368 | 416 | 386 | 236 | 487 | 328 | 629 | 551 | 627 | 119 | 903 | 996 | 320 | 222 | 779 | 438 | 747 |
88816807 | 521 | 219 | 928 | 440 | 778 | 219 | 583 | 128 | 243 | 761 | 523 | 365 | 755 | 195 | 449 | 279 | 969 | 605 |
15380507 | 958 | 204 | 633 | 379 | 522 | 609 | 746 | 175 | 816 | 227 | 812 | 399 | 695 | 105 | 475 | 216 | 288 | 631 |
14420025 | 718 | 232 | 781 | 142 | 680 | 610 | 230 | 549 | 787 | 801 | 960 | 167 | 597 | 804 | 146 | 586 | 732 | 224 |
The issue is that there is no year column in this dataset, which I want to add manually so that I can I graph the data. To do so I need to normalize the data and to have only 3 columns for each value (sales, costs, unitssold).
In the end I would like something like this:
Item_ID | Year | Sales | Costs | UnitsSold |
36319622 | 2010 | 712 | 372 | 586 |
36319622 | 2011 | 593 | 123 | 601 |
36319622 | 2012 | 458 | 214 | 896 |
36319622 | 2013 | 191 | 163 | 690 |
36319622 | 2014 | 355 | 935 | 662 |
36319622 | 2015 | 820 | 498 | 481 |
49355938 | 2010 | 708 | 109 | 447 |
49355938 | 2011 | 597 | 714 | 524 |
49355938 | 2012 | 602 | 144 | 485 |
49355938 | 2013 | 405 | 633 | 705 |
49355938 | 2014 | 202 | 521 | 333 |
49355938 | 2015 | 220 | 190 | 236 |
What is the best way to go about cleaning the data to more like the bottom graph?
Thank you!