blob: 7e1a395b368f9ea673ebde5e24a10911fb1519bb [file] [log] [blame]
{"version":3,"sources":["webpack:///./src/pages/docs/Creating Charts and Dashboards/exploring-data.mdx"],"names":["_frontmatter","layoutProps","MDXLayout","DefaultLayout","MDXContent","components","props","mdxType","parentName","src","isMDXComponent"],"mappings":"wPAQaA,G,UAAe,S,kPAC5B,IAAMC,EAAc,CAClBD,gBAEIE,EAAYC,IACH,SAASC,EAAT,GAGZ,IAFDC,EAEC,EAFDA,WACGC,EACF,8BACD,OAAO,YAACJ,EAAD,eAAeD,EAAiBK,EAAhC,CAAuCD,WAAYA,EAAYE,QAAQ,cAG5E,iBAAQ,CACN,GAAM,8BADR,8BAGA,+QAGA,sBACE,kBAAIC,WAAW,MAAf,+HAEA,kBAAIA,WAAW,MAAf,2BACA,kBAAIA,WAAW,MAAf,0EACA,kBAAIA,WAAW,MAAf,8CACA,kBAAIA,WAAW,MAAf,uBACA,kBAAIA,WAAW,MAAf,iDACA,kBAAIA,WAAW,MAAf,yEAEF,iBAAQ,CACN,GAAM,sCADR,sCAGA,6MAEA,gDAA+B,sBAAQA,WAAW,KAAnB,oBAA/B,cAAkG,sBAAQA,WAAW,KAAnB,YAAlG,yCACS,sBAAQA,WAAW,KAAnB,QADT,YAEA,mBAAKC,IAAI,4BACT,qEAAoD,sBAAQD,WAAW,KAAnB,SAApD,mCACoB,sBAAQA,WAAW,KAAnB,qBADpB,yBACmG,sBAAQA,WAAW,KAAnB,QADnG,YAEA,mBAAKC,IAAI,gCACT,iBAAQ,CACN,GAAM,oBADR,oBAGA,wEACF,6BAAGD,WAAW,KAAQ,CAChB,KAAQ,gGADd,UADE,mCAI2B,sBAAQA,WAAW,KAAnB,uBAJ3B,KAKA,mBAAKC,IAAI,6BACT,wCAAuB,sBAAQD,WAAW,KAAnB,cAAvB,OAA6E,kBAAIA,WAAW,KAAf,oBAA7E,gDACA,mBAAKC,IAAI,8CACT,4CAA2B,kBAAID,WAAW,KAAf,eAA3B,aAAgF,sBA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BAAKC,IAAI,yBACT,8QAGF,6BAAGD,WAAW,KAAQ,CAChB,KAAQ,8FADd,wBAHE,KAMA,sN,gPAMJJ,EAAWM,gBAAiB","file":"component---src-pages-docs-creating-charts-and-dashboards-exploring-data-mdx-f2389bfef700b5138269.js","sourcesContent":["import * as React from 'react'\n /* @jsx mdx */\nimport { mdx } from '@mdx-js/react';\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\n\nimport DefaultLayout from \"/home/runner/work/superset/superset/docs/node_modules/gatsby-theme-docz/src/base/Layout.js\";\nexport const _frontmatter = {};\nconst layoutProps = {\n _frontmatter\n};\nconst MDXLayout = DefaultLayout;\nexport default function MDXContent({\n components,\n ...props\n}) {\n return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n\n\n <h2 {...{\n \"id\": \"exploring-data-in-superset\"\n }}>{`Exploring Data in Superset`}</h2>\n <p>{`In this tutorial, we will introduce key concepts in Apache Superset through the exploration of a\nreal dataset which contains the flights made by employees of a UK-based organization in 2011. The\nfollowing information about each flight is given:`}</p>\n <ul>\n <li parentName=\"ul\">{`The traveller’s department. For the purposes of this tutorial the departments have been renamed\nOrange, Yellow and Purple.`}</li>\n <li parentName=\"ul\">{`The cost of the ticket.`}</li>\n <li parentName=\"ul\">{`The travel class (Economy, Premium Economy, Business and First Class).`}</li>\n <li parentName=\"ul\">{`Whether the ticket was a single or return.`}</li>\n <li parentName=\"ul\">{`The date of travel.`}</li>\n <li parentName=\"ul\">{`Information about the origin and destination.`}</li>\n <li parentName=\"ul\">{`The distance between the origin and destination, in kilometers (km).`}</li>\n </ul>\n <h3 {...{\n \"id\": \"enabling-data-upload-functionality\"\n }}>{`Enabling Data Upload Functionality`}</h3>\n <p>{`You may need to enable the functionality to upload a CSV or Excel file to your database. The following section\nexplains how to enable this functionality for the examples database.`}</p>\n <p>{`In the top menu, select `}<strong parentName=\"p\">{`Data ‣ Databases`}</strong>{`. Find the `}<strong parentName=\"p\">{`examples`}</strong>{` database in the list and\nselect the `}<strong parentName=\"p\">{`Edit`}</strong>{` button.`}</p>\n <img src=\"/images/edit-record.png\" />\n <p>{`In the resulting modal window, switch to the `}<strong parentName=\"p\">{`Extra`}</strong>{` tab and\ntick the checkbox for `}<strong parentName=\"p\">{`Allow Data Upload`}</strong>{`. End by clicking the `}<strong parentName=\"p\">{`Save`}</strong>{` button.`}</p>\n <img src=\"/images/add-data-upload.png\" />\n <h3 {...{\n \"id\": \"loading-csv-data\"\n }}>{`Loading CSV Data`}</h3>\n <p>{`Download the CSV dataset to your computer from\n`}<a parentName=\"p\" {...{\n \"href\": \"https://raw.githubusercontent.com/apache-superset/examples-data/master/tutorial_flights.csv\"\n }}>{`Github`}</a>{`.\nIn the Superset menu, select `}<strong parentName=\"p\">{`Data ‣ Upload a CSV`}</strong>{`.`}</p>\n <img src=\"/images/upload_a_csv.png\" />\n <p>{`Then, enter the `}<strong parentName=\"p\">{`Table Name`}</strong>{` as `}<em parentName=\"p\">{`tutorial_flights`}</em>{` and select the CSV file from your computer.`}</p>\n <img src=\"/images/csv_to_database_configuration.png\" />\n <p>{`Next enter the text `}<em parentName=\"p\">{`Travel Date`}</em>{` into the `}<strong parentName=\"p\">{`Parse Dates`}</strong>{` field.`}</p>\n <img src=\"/images/parse_dates_column.png\" />\n <p>{`Leaving all the other options in their default settings, select `}<strong parentName=\"p\">{`Save`}</strong>{` at the bottom of the page.`}</p>\n <h3 {...{\n \"id\": \"table-visualization\"\n }}>{`Table Visualization`}</h3>\n <p>{`You should now see `}<em parentName=\"p\">{`tutorial_flights`}</em>{` as a dataset in the `}<strong parentName=\"p\">{`Datasets`}</strong>{` tab. Click on the entry to\nlaunch an Explore workflow using this dataset.`}</p>\n <p>{`In this section, we'll create a table visualization\nto show the number of flights and cost per travel class.`}</p>\n <p>{`By default, Apache Superset only shows the last week of data. In our example, we want to visualize all\nof the data in the dataset. Click the `}<strong parentName=\"p\">{`Time ‣ Time Range`}</strong>{` section and change\nthe `}<strong parentName=\"p\">{`Range Type`}</strong>{` to `}<strong parentName=\"p\">{`No Filter`}</strong>{`.`}</p>\n <img src=\"/images/no_filter_on_time_filter.png\" />\n <p>{`Click `}<strong parentName=\"p\">{`Apply`}</strong>{` to save.`}</p>\n <p>{`Now, we want to specify the rows in our table by using the `}<strong parentName=\"p\">{`Group by`}</strong>{` option. Since in this\nexample, we want to understand different Travel Classes, we select `}<strong parentName=\"p\">{`Travel Class`}</strong>{` in this menu.`}</p>\n <p>{`Next, we can specify the metrics we would like to see in our table with the `}<strong parentName=\"p\">{`Metrics`}</strong>{` option.`}</p>\n <ul>\n <li parentName=\"ul\"><inlineCode parentName=\"li\">{`COUNT(*)`}</inlineCode>{`, which represents the number of rows in the table\n(in this case, quantity of flights in each Travel Class)`}</li>\n <li parentName=\"ul\"><inlineCode parentName=\"li\">{`SUM(Cost)`}</inlineCode>{`, which represents the total cost spent by each Travel Class`}</li>\n </ul>\n <img src=\"/images/sum_cost_column.png\" />\n <p>{`Finally, select `}<strong parentName=\"p\">{`Run Query`}</strong>{` to see the results of the table.`}</p>\n <img src=\"/images/tutorial_table.png\" />\n <p>{`To save the visualization, click on `}<strong parentName=\"p\">{`Save`}</strong>{` in the top left of the screen. In the following modal,`}</p>\n <ul>\n <li parentName=\"ul\">{`Select the `}<strong parentName=\"li\">{`Save as`}</strong>{`\noption and enter the chart name as Tutorial Table (you will be able to find it again through the\n`}<strong parentName=\"li\">{`Charts`}</strong>{` screen, accessible in the top menu).`}</li>\n <li parentName=\"ul\">{`Select `}<strong parentName=\"li\">{`Add To Dashboard`}</strong>{` and enter\nTutorial Dashboard. Finally, select `}<strong parentName=\"li\">{`Save & Go To Dashboard`}</strong>{`.`}</li>\n </ul>\n <img src=\"/images/save_tutorial_table.png\" />\n <h3 {...{\n \"id\": \"dashboard-basics\"\n }}>{`Dashboard Basics`}</h3>\n <p>{`Next, we are going to explore the dashboard interface. If you’ve followed the previous section, you\nshould already have the dashboard open. Otherwise, you can navigate to the dashboard by selecting\nDashboards on the top menu, then Tutorial dashboard from the list of dashboards.`}</p>\n <p>{`On this dashboard you should see the table you created in the previous section. Select `}<strong parentName=\"p\">{`Edit\ndashboard`}</strong>{` and then hover over the table. By selecting the bottom right hand corner of the table\n(the cursor will change too), you can resize it by dragging and dropping.`}</p>\n <img src=\"/images/resize_tutorial_table_on_dashboard.png\" />\n <p>{`Finally, save your changes by selecting Save changes in the top right.`}</p>\n <h3 {...{\n \"id\": \"pivot-table\"\n }}>{`Pivot Table`}</h3>\n <p>{`In this section, we will extend our analysis using a more complex visualization, Pivot Table. By the\nend of this section, you will have created a table that shows the monthly spend on flights for the\nfirst six months, by department, by travel class.`}</p>\n <p>{`Create a new chart by selecting `}<strong parentName=\"p\">{`+ ‣ Chart`}</strong>{` from the top right corner. Choose\ntutorial_flights again as a datasource, then click on the visualization type to get to the\nvisualization menu. Select the `}<strong parentName=\"p\">{`Pivot Table`}</strong>{` visualization (you can filter by entering text in the\nsearch box) and then `}<strong parentName=\"p\">{`Create New Chart`}</strong>{`.`}</p>\n <img src=\"/images/create_pivot.png\" />\n <p>{`In the `}<strong parentName=\"p\">{`Time`}</strong>{` section, keep the Time Column as Travel Date (this is selected automatically as we\nonly have one time column in our dataset). Then select Time Grain to be month as having daily data\nwould be too granular to see patterns from. Then select the time range to be the first six months of\n2011 by click on Last week in the Time Range section, then in Custom selecting a Start / end of 1st\nJanuary 2011 and 30th June 2011 respectively by either entering directly the dates or using the\ncalendar widget (by selecting the month name and then the year, you can move more quickly to far\naway dates).`}</p>\n <img src=\"/images/select_dates_pivot_table.png\" />\n <p>{`Next, within the `}<strong parentName=\"p\">{`Query`}</strong>{` section, remove the default COUNT(`}{`*`}{`) and add Cost, keeping the default\nSUM aggregate. Note that Apache Superset will indicate the type of the metric by the symbol on the\nleft hand column of the list (ABC for string, # for number, a clock face for time, etc.).`}</p>\n <p>{`In `}<strong parentName=\"p\">{`Group by`}</strong>{` select `}<strong parentName=\"p\">{`Time`}</strong>{`: this will automatically use the Time Column and Time Grain\nselections we defined in the Time section.`}</p>\n <p>{`Within `}<strong parentName=\"p\">{`Columns`}</strong>{`, select first Department and then Travel Class. All set – let’s `}<strong parentName=\"p\">{`Run Query`}</strong>{` to\nsee some data!`}</p>\n <img src=\"/images/tutorial_pivot_table.png\" />\n <p>{`You should see months in the rows and Department and Travel Class in the columns. Publish this chart\nto your existing Tutorial Dashboard you created earlier.`}</p>\n <h3 {...{\n \"id\": \"line-chart\"\n }}>{`Line Chart`}</h3>\n <p>{`In this section, we are going to create a line chart to understand the average price of a ticket by\nmonth across the entire dataset.`}</p>\n <p>{`In the Time section, as before, keep the Time Column as Travel Date and Time Grain as month but this\ntime for the Time range select No filter as we want to look at entire dataset.`}</p>\n <p>{`Within Metrics, remove the default `}<inlineCode parentName=\"p\">{`COUNT(*)`}</inlineCode>{` metric and instead add `}<inlineCode parentName=\"p\">{`AVG(Cost)`}</inlineCode>{`, to show the mean value.`}</p>\n <img src=\"/images/average_aggregate_for_cost.png\" />\n <p>{`Next, select `}<strong parentName=\"p\">{`Run Query`}</strong>{` to show the data on the chart.`}</p>\n <p>{`How does this look? Well, we can see that the average cost goes up in December. However, perhaps it\ndoesn’t make sense to combine both single and return tickets, but rather show two separate lines for\neach ticket type.`}</p>\n <p>{`Let’s do this by selecting Ticket Single or Return in the Group by box, and the selecting `}<strong parentName=\"p\">{`Run\nQuery`}</strong>{` again. Nice! We can see that on average single tickets are cheaper than returns and that the\nbig spike in December is caused by return tickets.`}</p>\n <p>{`Our chart is looking pretty good already, but let’s customize some more by going to the Customize\ntab on the left hand pane. Within this pane, try changing the Color Scheme, removing the range\nfilter by selecting No in the Show Range Filter drop down and adding some labels using X Axis Label\nand Y Axis Label.`}</p>\n <img src=\"/images/tutorial_line_chart.png\" />\n <p>{`Once you’re done, publish the chart in your Tutorial Dashboard.`}</p>\n <h3 {...{\n \"id\": \"markup\"\n }}>{`Markup`}</h3>\n <p>{`In this section, we will add some text to our dashboard. If you’re there already, you can navigate\nto the dashboard by selecting Dashboards on the top menu, then Tutorial dashboard from the list of\ndashboards. Got into edit mode by selecting `}<strong parentName=\"p\">{`Edit dashboard`}</strong>{`.`}</p>\n <p>{`Within the Insert components pane, drag and drop a Markdown box on the dashboard. Look for the blue\nlines which indicate the anchor where the box will go.`}</p>\n <img src=\"/images/blue_bar_insert_component.png\" />\n <p>{`Now, to edit the text, select the box. You can enter text, in markdown format (see\n`}<a parentName=\"p\" {...{\n \"href\": \"https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet\"\n }}>{`this Markdown Cheatsheet`}</a>{` for\nmore information about this format). You can toggle between Edit and Preview using the menu on the\ntop of the box.`}</p>\n <img src=\"/images/markdown.png\" />\n <p>{`To exit, select any other part of the dashboard. Finally, don’t forget to keep your changes using\n`}<strong parentName=\"p\">{`Save changes`}</strong>{`.`}</p>\n <h3 {...{\n \"id\": \"filter-box\"\n }}>{`Filter Box`}</h3>\n <p>{`In this section, you will learn how to add a filter to your dashboard. Specifically, we will create\na filter that allows us to look at those flights that depart from a particular country.`}</p>\n <p>{`A filter box visualization can be created as any other visualization by selecting `}<strong parentName=\"p\">{`+ ‣ Chart`}</strong>{`,\nand then `}<em parentName=\"p\">{`tutorial_flights`}</em>{` as the datasource and Filter Box as the visualization type.`}</p>\n <p>{`First of all, in the `}<strong parentName=\"p\">{`Time`}</strong>{` section, remove the filter from the Time range selection by selecting\nNo filter.`}</p>\n <p>{`Next, in `}<strong parentName=\"p\">{`Filters Configurations`}</strong>{` first add a new filter by selecting the plus sign and then edit\nthe newly created filter by selecting the pencil icon.`}</p>\n <p>{`For our use case, it makes most sense to present a list of countries in alphabetical order. First,\nenter the column as Origin Country and keep all other options the same and then select `}<strong parentName=\"p\">{`Run\nQuery`}</strong>{`. This gives us a preview of our filter.`}</p>\n <p>{`Next, remove the date filter by unchecking the Date Filter checkbox.`}</p>\n <img src=\"/images/filter_on_origin_country.png\" />\n <p>{`Finally, select `}<strong parentName=\"p\">{`Save`}</strong>{`, name the chart as Tutorial Filter, add the chart to our existing Tutorial\nDashboard and then Save & go to dashboard. Once on the Dashboard, try using the filter to show only\nthose flights that departed from the United Kingdom – you will see the filter is applied to all of\nthe other visualizations on the dashboard.`}</p>\n <h3 {...{\n \"id\": \"publishing-your-dashboard\"\n }}>{`Publishing Your Dashboard`}</h3>\n <p>{`If you have followed all of the steps outlined in the previous section, you should have a dashboard\nthat looks like the below. If you would like, you can rearrange the elements of the dashboard by\nselecting `}<strong parentName=\"p\">{`Edit dashboard`}</strong>{` and dragging and dropping.`}</p>\n <p>{`If you would like to make your dashboard available to other users, simply select Draft next to the\ntitle of your dashboard on the top left to change your dashboard to be in Published state. You can\nalso favorite this dashboard by selecting the star.`}</p>\n <img src=\"/images/publish_dashboard.png\" />\n <h3 {...{\n \"id\": \"annotations\"\n }}>{`Annotations`}</h3>\n <p>{`Annotations allow you to add additional context to your chart. In this section, we will add an\nannotation to the Tutorial Line Chart we made in a previous section. Specifically, we will add the\ndates when some flights were cancelled by the UK’s Civil Aviation Authority in response to the\neruption of the Grímsvötn volcano in Iceland (23-25 May 2011).`}</p>\n <p>{`First, add an annotation layer by navigating to Manage ‣ Annotation Layers. Add a new annotation\nlayer by selecting the green plus sign to add a new record. Enter the name Volcanic Eruptions and\nsave. We can use this layer to refer to a number of different annotations.`}</p>\n <p>{`Next, add an annotation by navigating to Manage ‣ Annotations and then create a new annotation by\nselecting the green plus sign. Then, select the Volcanic Eruptions layer, add a short description\nGrímsvötn and the eruption dates (23-25 May 2011) before finally saving.`}</p>\n <img src=\"/images/edit_annotation.png\" />\n <p>{`Then, navigate to the line chart by going to Charts then selecting Tutorial Line Chart from the\nlist. Next, go to the Annotations and Layers section and select Add Annotation Layer. Within this\ndialogue:`}</p>\n <ul>\n <li parentName=\"ul\">{`Name the layer as Volcanic Eruptions`}</li>\n <li parentName=\"ul\">{`Change the Annotation Layer Type to Event`}</li>\n <li parentName=\"ul\">{`Set the Annotation Source as Superset annotation`}</li>\n <li parentName=\"ul\">{`Specify the Annotation Layer as Volcanic Eruptions`}</li>\n </ul>\n <img src=\"/images/annotation_settings.png\" />\n <p>{`Select `}<strong parentName=\"p\">{`Apply`}</strong>{` to see your annotation shown on the chart.`}</p>\n <img src=\"/images/annotation.png\" />\n <p>{`If you wish, you can change how your annotation looks by changing the settings in the Display\nconfiguration section. Otherwise, select `}<strong parentName=\"p\">{`OK`}</strong>{` and finally `}<strong parentName=\"p\">{`Save`}</strong>{` to save your chart. If you keep\nthe default selection to overwrite the chart, your annotation will be saved to the chart and also\nappear automatically in the Tutorial Dashboard.`}</p>\n <h3 {...{\n \"id\": \"advanced-analytics\"\n }}>{`Advanced Analytics`}</h3>\n <p>{`In this section, we are going to explore the Advanced Analytics feature of Apache Superset that\nallows you to apply additional transformations to your data. The three types of transformation are:`}</p>\n <p><strong parentName=\"p\">{`Setting up the base chart`}</strong></p>\n <p>{`In this section, we’re going to set up a base chart which we can then apply the different `}<strong parentName=\"p\">{`Advanced\nAnalytics`}</strong>{` features to. Start off by creating a new chart using the same `}<em parentName=\"p\">{`tutorial_flights`}</em>{`\ndatasource and the `}<strong parentName=\"p\">{`Line Chart`}</strong>{` visualization type. Within the Time section, set the Time Range as\n1st October 2011 and 31st October 2011.`}</p>\n <p>{`Next, in the query section, change the Metrics to the sum of Cost. Select `}<strong parentName=\"p\">{`Run Query`}</strong>{` to show the\nchart. You should see the total cost per day for each month in October 2011.`}</p>\n <img src=\"/images/advanced_analytics_base.png\" />\n <p>{`Finally, save the visualization as Tutorial Advanced Analytics Base, adding it to the Tutorial\nDashboard.`}</p>\n <h3 {...{\n \"id\": \"rolling-mean\"\n }}>{`Rolling Mean`}</h3>\n <p>{`There is quite a lot of variation in the data, which makes it difficult to identify any trend. One\napproach we can take is to show instead a rolling average of the time series. To do this, in the\n`}<strong parentName=\"p\">{`Moving Average`}</strong>{` subsection of `}<strong parentName=\"p\">{`Advanced Analytics`}</strong>{`, select mean in the `}<strong parentName=\"p\">{`Rolling`}</strong>{` box and\nenter 7 into both Periods and Min Periods. The period is the length of the rolling period expressed\nas a multiple of the Time Grain. In our example, the Time Grain is day, so the rolling period is 7\ndays, such that on the 7th October 2011 the value shown would correspond to the first seven days of\nOctober 2011. Lastly, by specifying Min Periods as 7, we ensure that our mean is always calculated\non 7 days and we avoid any ramp up period.`}</p>\n <p>{`After displaying the chart by selecting `}<strong parentName=\"p\">{`Run Query`}</strong>{` you will see that the data is less variable\nand that the series starts later as the ramp up period is excluded.`}</p>\n <img src=\"/images/rolling_mean.png\" />\n <p>{`Save the chart as Tutorial Rolling Mean and add it to the Tutorial Dashboard.`}</p>\n <h3 {...{\n \"id\": \"time-comparison\"\n }}>{`Time Comparison`}</h3>\n <p>{`In this section, we will compare values in our time series to the value a week before. Start off by\nopening the Tutorial Advanced Analytics Base chart, by going to `}<strong parentName=\"p\">{`Charts`}</strong>{` in the top menu and then\nselecting the visualization name in the list (alternatively, find the chart in the Tutorial\nDashboard and select Explore chart from the menu for that visualization).`}</p>\n <p>{`Next, in the Time Comparison subsection of `}<strong parentName=\"p\">{`Advanced Analytics`}</strong>{`, enter the Time Shift by typing in\n“minus 1 week” (note this box accepts input in natural language). Run Query to see the new chart,\nwhich has an additional series with the same values, shifted a week back in time.`}</p>\n <img src=\"/images/time_comparison_two_series.png\" />\n <p>{`Then, change the `}<strong parentName=\"p\">{`Calculation type`}</strong>{` to Absolute difference and select `}<strong parentName=\"p\">{`Run Query`}</strong>{`. We can now\nsee only one series again, this time showing the difference between the two series we saw\npreviously.`}</p>\n <img src=\"/images/time_comparison_absolute_difference.png\" />\n <p>{`Save the chart as Tutorial Time Comparison and add it to the Tutorial Dashboard.`}</p>\n <h3 {...{\n \"id\": \"resampling-the-data\"\n }}>{`Resampling the data`}</h3>\n <p>{`In this section, we’ll resample the data so that rather than having daily data we have weekly data.\nAs in the previous section, reopen the Tutorial Advanced Analytics Base chart.`}</p>\n <p>{`Next, in the Python Functions subsection of `}<strong parentName=\"p\">{`Advanced Analytics`}</strong>{`, enter 7D, corresponding to seven\ndays, in the Rule and median as the Method and show the chart by selecting `}<strong parentName=\"p\">{`Run Query`}</strong>{`.`}</p>\n <img src=\"/images/resample.png\" />\n <p>{`Note that now we have a single data point every 7 days. In our case, the value showed corresponds to\nthe median value within the seven daily data points. For more information on the meaning of the\nvarious options in this section, refer to the\n`}<a parentName=\"p\" {...{\n \"href\": \"https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html\"\n }}>{`Pandas documentation`}</a>{`.`}</p>\n <p>{`Lastly, save your chart as Tutorial Resample and add it to the Tutorial Dashboard. Go to the\ntutorial dashboard to see the four charts side by side and compare the different outputs.`}</p>\n\n </MDXLayout>;\n}\n;\nMDXContent.isMDXComponent = true;\n "],"sourceRoot":""}