{"id":247,"date":"2024-10-02T02:59:48","date_gmt":"2024-10-02T02:59:48","guid":{"rendered":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/chapter\/chapter-7-motion-visualizations\/"},"modified":"2024-10-10T08:14:59","modified_gmt":"2024-10-10T08:14:59","slug":"chapter-7-motion-visualizations","status":"publish","type":"chapter","link":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/chapter\/chapter-7-motion-visualizations\/","title":{"raw":"MOTION VISUALIZATIONS","rendered":"MOTION VISUALIZATIONS"},"content":{"raw":"<div class=\"chapter-7:-motion-visualizations\">\r\n<table class=\" aligncenter\">\r\n<tbody>\r\n<tr class=\"GridTable4-Accent5-R\" style=\"height: 0\">\r\n<td class=\"GridTable4-Accent5-C\" style=\"background-color: #5b9bd5;border-top: solid #5B9BD5 0.5pt;border-bottom: solid #5B9BD5 0.5pt;border-right: none windowtext 0pt;border-left: solid #5B9BD5 0.5pt\">\r\n<div class=\"GridTable4-Accent5-firstCol\">\r\n<div class=\"GridTable4-Accent5-firstRow\">\r\n<p class=\"import-Normal\"><img src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image1-6.png\" alt=\"image\" width=\"96px\" height=\"96px\" \/><\/p>\r\n\r\n<\/div>\r\n<\/div><\/td>\r\n<td class=\"GridTable4-Accent5-C\" style=\"background-color: #5b9bd5;border: solid #9CC2E5 0.5pt\">\r\n<div class=\"GridTable4-Accent5-firstRow\">\r\n<p class=\"import-Normal\">By the end of this chapter, readers will be able to:<\/p>\r\n\r\n<ul>\r\n \t<li>Build motion line charts using Tableau<\/li>\r\n \t<li>Build race bars using Tableau<\/li>\r\n<\/ul>\r\n<p class=\"import-Normal\"><\/p>\r\n\r\n<\/div><\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<h2><a id=\"_Toc178253056\"><\/a><strong>M<\/strong><strong>otion <\/strong><strong>L<\/strong><strong>ine <\/strong><strong>C<\/strong><strong>hart<\/strong><\/h2>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Motion line charts, also known as animated line charts, not only make data presentations more engaging but also allow us to observe how values fluctuate over a specific time range. This helps in identifying any exciting or abnormal value transitions. In Tableau, you can create a motion line chart by placing a date field on the Pages shelf. This will split the line chart into a series of pages, creating animations that clearly show how values change over time, such as years, quarters, or months.<\/p>\r\n\r\n<h3><a id=\"_Toc178253057\"><\/a><strong>Exercise 31<\/strong><\/h3>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Create a motion line chart to illustrate the fluctuations in total sales across different regions over various quarters and years.<\/p>\r\n<p class=\"import-Normal\"><strong>Solution - Exercise 31<\/strong><\/p>\r\n<p class=\"import-Normal\">Step 1: Drag and drop the <strong>Order Date<\/strong> onto the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf and the <strong>Sales<\/strong> field onto the <strong>Rows<\/strong> shelf. Name the resulting line chart <strong>VIZ 27<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image194.png\" alt=\"image\" width=\"687\" height=\"411\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 2: Click the down arrow next to the <strong>Order D<\/strong><strong>ate<\/strong> field in the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf. Under the continuous date format section, choose <strong>Quarter<\/strong> to change the time frame to quarters by year.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image195.png\" alt=\"image\" width=\"221\" height=\"530\" \/><\/p>\r\n<p class=\"import-Normal\">Step 3- Change the type of marks to <strong>C<\/strong><strong>ircle<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image196.png\" alt=\"image\" width=\"184\" height=\"433\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 4: Press and hold the <strong>Ctrl<\/strong> key, then click and drag the <strong>QUARTER(Order Date)<\/strong> field from the <strong>Rows<\/strong> shelf to the <strong>Pages<\/strong> shelf.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image197.png\" alt=\"image\" width=\"484\" height=\"69\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 5: Check the <strong>S<\/strong><strong>how <\/strong><strong>H<\/strong><strong>istory<\/strong> box in the <strong>Pages<\/strong> card, appearing to the right of the worksheet.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image198.png\" alt=\"image\" width=\"220\" height=\"143\" \/><\/p>\r\n<p class=\"import-Normal\">Step 6: Click the down arrow next to <strong>Show History. <\/strong> For a standard animated chart, choose <strong>All<\/strong> under the <strong>Marks to Show History <\/strong><strong>F<\/strong><strong>or<\/strong>, and choose <strong>Both<\/strong> in the <strong>Show<\/strong> section.<\/p>\r\n<p class=\"import-Normal\"><img class=\"aligncenter wp-image-233\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703.png\" alt=\"\" width=\"726\" height=\"354\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 7: Add the <strong>Region<\/strong> field to the <strong>Colour<\/strong> <strong>C<\/strong><strong>ard<\/strong> to display different lines for each region within the same chart.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image200.png\" alt=\"image\" width=\"449\" height=\"434\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 8: Click the <strong>Play<\/strong> button on the <strong>Pages<\/strong> card to observe how sales fluctuate for each region across different periods. Note that we can also control the speed of the animations using the options available on the <strong>Pages<\/strong> card.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\"><img src=\"#fixme\" alt=\"image\" width=\"109.466666666667px\" height=\"24px\" \/>Speed control\r\n<img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image201.png\" alt=\"image\" width=\"719\" height=\"343\" \/><\/p>\r\n[h5p id=\"19\"]\r\n\r\n[h5p id=\"20\"]\r\n<h2><a id=\"_Toc178253058\"><\/a><strong>Race <\/strong><strong>B<\/strong><strong>ar<\/strong><\/h2>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Race bars help illustrate how multiple items, such as states, regions, or companies, perform or change over time. A race bar helps trace progress, evaluate growth, or detect shifts in data. In Tableau, a race bar can be created using the Pages shelf to animate changes in the data, allowing users to show how values evolve over different periods.<\/p>\r\n\r\n<h3><a id=\"_Toc178253059\"><\/a><strong>Exercise 32<\/strong><\/h3>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Construct a race bar chart to display the top ten states for each quarter and year, based on total sales.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\"><strong>Solution \u2013 Exercise 32<\/strong><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 1: Open a new worksheet and name it <strong>VIZ 28<\/strong>. Create a calculated field for the running sales using the <strong>RUNNING_SUM<\/strong> function. Name the calculated field <strong>Running Sales<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image202.png\" alt=\"image\" width=\"499\" height=\"237\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 2: Create a calculated field using the <strong>Rank_Unique<\/strong> function to rank the running sales. Use the following expression, which incorporates the <strong>Running Sales<\/strong> field. Name the calculated field <strong>Rank<\/strong><strong>ing<\/strong><strong> Sales<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image203.png\" alt=\"image\" width=\"513\" height=\"242\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 3: Drag the <strong>Sales<\/strong> field onto the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf and the <strong>Ranking Sales<\/strong> field onto the <strong>Rows<\/strong> shelf. Add the <strong>State<\/strong> field to the <strong>Colour<\/strong> <strong>C<\/strong><strong>ard<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image204.png\" alt=\"image\" width=\"717\" height=\"339\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 4: Add the <strong>Order Date<\/strong> field to the <strong>Pages<\/strong> shelf. Click the down arrow next to the added <strong>Order Date<\/strong> and choose <strong>Month<\/strong> under the continuous date options. This allows Tableau to organize the data into separate pages by month and year.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image205.png\" alt=\"image\" width=\"234\" height=\"532\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 5: Click the down arrow next to the <strong>Ranking Sales<\/strong> field in the <strong>Rows<\/strong> shelf. Set the <strong>Ranking Sales<\/strong> field to <strong>Discrete<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image206.png\" alt=\"image\" width=\"335\" height=\"359\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 6: Click the down arrow next to the <strong>Ranking Sales<\/strong> field in the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf and choose <strong>Edit Table Calculation<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image207.png\" alt=\"image\" width=\"221\" height=\"444\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 7 \u2013 Under <strong>Compute Using<\/strong>, choose <strong>Specific Dimensions<\/strong> to select the <strong>State<\/strong> field. Then, switch the <strong>Nested Calculations<\/strong> option to <strong>Running Sales<\/strong>, and click <strong>Specific <\/strong><strong>Dimensions<\/strong> to choose <strong>Month of Order Date<\/strong>. Also, make sure the <strong>Running Sales<\/strong> field on the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf has the same calculation setting by verifying its <strong>Table Calculation<\/strong>; it should be computed using the <strong>Month of Order Date<\/strong>. This setup ensures that Tableau calculates the ranking sales by <strong>State<\/strong> for each <strong>Month of Order Date<\/strong>, with running sales computed by <strong>Month of Order Date<\/strong> for each <strong>State<\/strong>.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image208.png\" alt=\"image\" width=\"232.011968503937px\" height=\"374.685879265092px\" \/><img src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image209.png\" alt=\"image\" width=\"219.333333333333px\" height=\"373.678950131234px\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 7: Copy the discrete <strong>Ranking Sales<\/strong> field from the <strong>Rows<\/strong> shelf and add it to the Filter shelf. To do this, hold the Ctrl button, click the <strong>Ranking Sales<\/strong> field in the <strong>Rows<\/strong> shelf, and drag it onto the <strong>Filter<\/strong> shelf. Then, edit the filter to display only the ten states with the highest running sales.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image210.png\" alt=\"image\" width=\"362\" height=\"525\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 8: Click <strong>Format<\/strong> on the toolbar and choose <strong>Animations<\/strong>. In the <strong>Animations<\/strong> setting, configure the Style and Duration of the animation according to your preferences.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: center\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image211.png\" alt=\"image\" width=\"303\" height=\"539\" \/><\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 9: Add the <strong>State<\/strong> and <strong>Running Sales<\/strong> fields to the <strong>Label<\/strong> <strong>C<\/strong><strong>ard<\/strong>. For an improved animation experience, save the completed race bar to your Tableau Public profile and press play in the Pages control card to see the transitions between bars at different time points.<\/p>\r\n<p class=\"import-Normal\" style=\"text-align: justify\"><img class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image212.png\" alt=\"image\" width=\"723\" height=\"376\" \/><\/p>\r\n[h5p id=\"21\"]\r\n<p class=\"import-Normal\" style=\"text-align: justify\"><\/p>\r\n\r\n<\/div>","rendered":"<div class=\"chapter-7:-motion-visualizations\">\n<table class=\"aligncenter\">\n<tbody>\n<tr class=\"GridTable4-Accent5-R\" style=\"height: 0\">\n<td class=\"GridTable4-Accent5-C\" style=\"background-color: #5b9bd5;border-top: solid #5B9BD5 0.5pt;border-bottom: solid #5B9BD5 0.5pt;border-right: none windowtext 0pt;border-left: solid #5B9BD5 0.5pt\">\n<div class=\"GridTable4-Accent5-firstCol\">\n<div class=\"GridTable4-Accent5-firstRow\">\n<p class=\"import-Normal\"><img decoding=\"async\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image1-6.png\" alt=\"image\" width=\"96px\" height=\"96px\" \/><\/p>\n<\/div>\n<\/div>\n<\/td>\n<td class=\"GridTable4-Accent5-C\" style=\"background-color: #5b9bd5;border: solid #9CC2E5 0.5pt\">\n<div class=\"GridTable4-Accent5-firstRow\">\n<p class=\"import-Normal\">By the end of this chapter, readers will be able to:<\/p>\n<ul>\n<li>Build motion line charts using Tableau<\/li>\n<li>Build race bars using Tableau<\/li>\n<\/ul>\n<p class=\"import-Normal\">\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><a id=\"_Toc178253056\"><\/a><strong>M<\/strong><strong>otion <\/strong><strong>L<\/strong><strong>ine <\/strong><strong>C<\/strong><strong>hart<\/strong><\/h2>\n<p class=\"import-Normal\" style=\"text-align: justify\">Motion line charts, also known as animated line charts, not only make data presentations more engaging but also allow us to observe how values fluctuate over a specific time range. This helps in identifying any exciting or abnormal value transitions. In Tableau, you can create a motion line chart by placing a date field on the Pages shelf. This will split the line chart into a series of pages, creating animations that clearly show how values change over time, such as years, quarters, or months.<\/p>\n<h3><a id=\"_Toc178253057\"><\/a><strong>Exercise 31<\/strong><\/h3>\n<p class=\"import-Normal\" style=\"text-align: justify\">Create a motion line chart to illustrate the fluctuations in total sales across different regions over various quarters and years.<\/p>\n<p class=\"import-Normal\"><strong>Solution &#8211; Exercise 31<\/strong><\/p>\n<p class=\"import-Normal\">Step 1: Drag and drop the <strong>Order Date<\/strong> onto the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf and the <strong>Sales<\/strong> field onto the <strong>Rows<\/strong> shelf. Name the resulting line chart <strong>VIZ 27<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image194.png\" alt=\"image\" width=\"687\" height=\"411\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 2: Click the down arrow next to the <strong>Order D<\/strong><strong>ate<\/strong> field in the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf. Under the continuous date format section, choose <strong>Quarter<\/strong> to change the time frame to quarters by year.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image195.png\" alt=\"image\" width=\"221\" height=\"530\" \/><\/p>\n<p class=\"import-Normal\">Step 3- Change the type of marks to <strong>C<\/strong><strong>ircle<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image196.png\" alt=\"image\" width=\"184\" height=\"433\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 4: Press and hold the <strong>Ctrl<\/strong> key, then click and drag the <strong>QUARTER(Order Date)<\/strong> field from the <strong>Rows<\/strong> shelf to the <strong>Pages<\/strong> shelf.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image197.png\" alt=\"image\" width=\"484\" height=\"69\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 5: Check the <strong>S<\/strong><strong>how <\/strong><strong>H<\/strong><strong>istory<\/strong> box in the <strong>Pages<\/strong> card, appearing to the right of the worksheet.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image198.png\" alt=\"image\" width=\"220\" height=\"143\" \/><\/p>\n<p class=\"import-Normal\">Step 6: Click the down arrow next to <strong>Show History. <\/strong> For a standard animated chart, choose <strong>All<\/strong> under the <strong>Marks to Show History <\/strong><strong>F<\/strong><strong>or<\/strong>, and choose <strong>Both<\/strong> in the <strong>Show<\/strong> section.<\/p>\n<p class=\"import-Normal\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-233\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703.png\" alt=\"\" width=\"726\" height=\"354\" srcset=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703.png 1920w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-300x146.png 300w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-1024x500.png 1024w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-768x375.png 768w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-1536x750.png 1536w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-65x32.png 65w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-225x110.png 225w, https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image199-e1728547260703-350x171.png 350w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 7: Add the <strong>Region<\/strong> field to the <strong>Colour<\/strong> <strong>C<\/strong><strong>ard<\/strong> to display different lines for each region within the same chart.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image200.png\" alt=\"image\" width=\"449\" height=\"434\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 8: Click the <strong>Play<\/strong> button on the <strong>Pages<\/strong> card to observe how sales fluctuate for each region across different periods. Note that we can also control the speed of the animations using the options available on the <strong>Pages<\/strong> card.<\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\"><img decoding=\"async\" src=\"#fixme\" alt=\"image\" width=\"109.466666666667px\" height=\"24px\" \/>Speed control<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image201.png\" alt=\"image\" width=\"719\" height=\"343\" \/><\/p>\n<div id=\"h5p-19\">\n<div class=\"h5p-iframe-wrapper\"><iframe id=\"h5p-iframe-19\" class=\"h5p-iframe\" data-content-id=\"19\" style=\"height:1px\" src=\"about:blank\" frameBorder=\"0\" scrolling=\"no\" title=\"Common data in Pages\"><\/iframe><\/div>\n<\/div>\n<div id=\"h5p-20\">\n<div class=\"h5p-iframe-wrapper\"><iframe id=\"h5p-iframe-20\" class=\"h5p-iframe\" data-content-id=\"20\" style=\"height:1px\" src=\"about:blank\" frameBorder=\"0\" scrolling=\"no\" title=\"Pages navigation\"><\/iframe><\/div>\n<\/div>\n<h2><a id=\"_Toc178253058\"><\/a><strong>Race <\/strong><strong>B<\/strong><strong>ar<\/strong><\/h2>\n<p class=\"import-Normal\" style=\"text-align: justify\">Race bars help illustrate how multiple items, such as states, regions, or companies, perform or change over time. A race bar helps trace progress, evaluate growth, or detect shifts in data. In Tableau, a race bar can be created using the Pages shelf to animate changes in the data, allowing users to show how values evolve over different periods.<\/p>\n<h3><a id=\"_Toc178253059\"><\/a><strong>Exercise 32<\/strong><\/h3>\n<p class=\"import-Normal\" style=\"text-align: justify\">Construct a race bar chart to display the top ten states for each quarter and year, based on total sales.<\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\"><strong>Solution \u2013 Exercise 32<\/strong><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 1: Open a new worksheet and name it <strong>VIZ 28<\/strong>. Create a calculated field for the running sales using the <strong>RUNNING_SUM<\/strong> function. Name the calculated field <strong>Running Sales<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image202.png\" alt=\"image\" width=\"499\" height=\"237\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 2: Create a calculated field using the <strong>Rank_Unique<\/strong> function to rank the running sales. Use the following expression, which incorporates the <strong>Running Sales<\/strong> field. Name the calculated field <strong>Rank<\/strong><strong>ing<\/strong><strong> Sales<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image203.png\" alt=\"image\" width=\"513\" height=\"242\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 3: Drag the <strong>Sales<\/strong> field onto the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf and the <strong>Ranking Sales<\/strong> field onto the <strong>Rows<\/strong> shelf. Add the <strong>State<\/strong> field to the <strong>Colour<\/strong> <strong>C<\/strong><strong>ard<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image204.png\" alt=\"image\" width=\"717\" height=\"339\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 4: Add the <strong>Order Date<\/strong> field to the <strong>Pages<\/strong> shelf. Click the down arrow next to the added <strong>Order Date<\/strong> and choose <strong>Month<\/strong> under the continuous date options. This allows Tableau to organize the data into separate pages by month and year.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image205.png\" alt=\"image\" width=\"234\" height=\"532\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 5: Click the down arrow next to the <strong>Ranking Sales<\/strong> field in the <strong>Rows<\/strong> shelf. Set the <strong>Ranking Sales<\/strong> field to <strong>Discrete<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image206.png\" alt=\"image\" width=\"335\" height=\"359\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 6: Click the down arrow next to the <strong>Ranking Sales<\/strong> field in the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf and choose <strong>Edit Table Calculation<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image207.png\" alt=\"image\" width=\"221\" height=\"444\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 7 \u2013 Under <strong>Compute Using<\/strong>, choose <strong>Specific Dimensions<\/strong> to select the <strong>State<\/strong> field. Then, switch the <strong>Nested Calculations<\/strong> option to <strong>Running Sales<\/strong>, and click <strong>Specific <\/strong><strong>Dimensions<\/strong> to choose <strong>Month of Order Date<\/strong>. Also, make sure the <strong>Running Sales<\/strong> field on the <strong>C<\/strong><strong>olumn<\/strong><strong>s<\/strong> shelf has the same calculation setting by verifying its <strong>Table Calculation<\/strong>; it should be computed using the <strong>Month of Order Date<\/strong>. This setup ensures that Tableau calculates the ranking sales by <strong>State<\/strong> for each <strong>Month of Order Date<\/strong>, with running sales computed by <strong>Month of Order Date<\/strong> for each <strong>State<\/strong>.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image208.png\" alt=\"image\" width=\"232.011968503937px\" height=\"374.685879265092px\" \/><img decoding=\"async\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image209.png\" alt=\"image\" width=\"219.333333333333px\" height=\"373.678950131234px\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 7: Copy the discrete <strong>Ranking Sales<\/strong> field from the <strong>Rows<\/strong> shelf and add it to the Filter shelf. To do this, hold the Ctrl button, click the <strong>Ranking Sales<\/strong> field in the <strong>Rows<\/strong> shelf, and drag it onto the <strong>Filter<\/strong> shelf. Then, edit the filter to display only the ten states with the highest running sales.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image210.png\" alt=\"image\" width=\"362\" height=\"525\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 8: Click <strong>Format<\/strong> on the toolbar and choose <strong>Animations<\/strong>. In the <strong>Animations<\/strong> setting, configure the Style and Duration of the animation according to your preferences.<\/p>\n<p class=\"import-Normal\" style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image211.png\" alt=\"image\" width=\"303\" height=\"539\" \/><\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\">Step 9: Add the <strong>State<\/strong> and <strong>Running Sales<\/strong> fields to the <strong>Label<\/strong> <strong>C<\/strong><strong>ard<\/strong>. For an improved animation experience, save the completed race bar to your Tableau Public profile and press play in the Pages control card to see the transitions between bars at different time points.<\/p>\n<p class=\"import-Normal\" style=\"text-align: justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-content\/uploads\/sites\/190\/2024\/10\/image212.png\" alt=\"image\" width=\"723\" height=\"376\" \/><\/p>\n<div id=\"h5p-21\">\n<div class=\"h5p-iframe-wrapper\"><iframe id=\"h5p-iframe-21\" class=\"h5p-iframe\" data-content-id=\"21\" style=\"height:1px\" src=\"about:blank\" frameBorder=\"0\" scrolling=\"no\" title=\"Race bar\"><\/iframe><\/div>\n<\/div>\n<p class=\"import-Normal\" style=\"text-align: justify\">\n<\/div>\n","protected":false},"author":131,"menu_order":7,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-247","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/chapters\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/wp\/v2\/users\/131"}],"version-history":[{"count":3,"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/chapters\/247\/revisions"}],"predecessor-version":[{"id":390,"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/chapters\/247\/revisions\/390"}],"part":[{"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/chapters\/247\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/pressbooks\/v2\/chapter-type?post=247"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/wp\/v2\/contributor?post=247"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/openbook.ums.edu.my\/essentialsofdatavisualizationwithtableau\/wp-json\/wp\/v2\/license?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}