The table created by SQLExecute is actually a table of tables. The first parameter that BarChart expects is a list of values. ![]() One of those reasons is that we’ve created lists within the function. If one looks at the documentation for BarChart, this example does not appear to follow the same rules at first glance. ![]() Once the results from the database have been returned, we can pass them to the BarChart function. Next, build the query as described above using the SQLExecute function like so: So when we build our query in Mathematica, we’ll just use, “SELECT Name, SalesLastYear FROM Sales.SalesTerritory”.Īs described in a previous post, make sure to import DatabaseLink and set up your database connection to SQL Server. The target table for this example is one that has easy to graph data: Sales.SalesTerritory. For the purposes of this example, we’re going to pull a basic select query from the AdventureWorks database and graph it. ![]() To build a bar chart in Mathematica, the function we would use is BarChart. In this post, we’re going to build a basic bar chart that extracts data from a simple query in SQL Server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |