Netherlands: Software

Introductie van Micorosoft SQL Server 2016

Issue link:

Contents of this Issue


Page 124 of 212

112 C H A P T E R 6 | More analytics the expression and return to the Analysis Services engine. Notice that a variable can be a scalar variable or a table. Example 6-2: Creating a complex DAX expression with variables Non Bikes Sales Under $50 % of Total:= // create a table for all categories except Bikes var tNonBikes = filter(values(Category[CategoryName]), Category[CategoryName]<> "Bikes") // get the total of sales for tNonBikes table where UnitPrice is less than 50 var NonBikeSalesUnder50 = sumx(tNonBikes, calculate(sum([SalesAmount]),'Internet Sales'[UnitPrice]<50)) // get the total of all sales for tNonBikes table var NonBikeAllSales = sumx(tNonBikes, calculate(sum([SalesAmount]))) // divide the first total by the second total return NonBikeSalesUnder50 / NonBikeAllSales As an alternative, you could create intermediate measures for NonBikeSalesUnder50 and NonBikeAllSales and then divide the former by the latter to obtain the final result. That approach would be preferable if you were to require the results of the intermediate measures in other expressions because variables are limited in scope to a single expression. If these results are not required elsewhere, consolidating the logic into one expression and using variables helps you to more easily see the flow of the expression evaluation. R integration R is a popular open-source programming language used by data scientists, statisticians, and data analysts for advanced analytics, data exploration, and machine learning. Despite its popularity, the use of R in an enterprise environment can be challenging. Many tools for R operate in a single-threaded, memory-bound desktop environment, which puts constraints on the volume of data that you can analyze. In addition, moving sensitive data from a server environment to the desktop removes it from the security controls built into the database. SQL Server R Services, the result of Microsoft's acquisition in 2015 of Revolution Analytics, resolves these challenges by integrating a unique R distribution into the SQL Server platform. You can execute R code directly in a SQL Server database when using R Services (In-Database) and reuse the code in another platform, such as Hadoop. In addition, the workload shifts from the desktop to the server and maintains the necessary levels of security for your data. In Enterprise Edition, R Services performs multithreaded, multicore, and parallelized multiprocessor computations at high speed. Using R Services, you can build intelligent, predictive applications that you can easily deploy to production. Installing and configuring R Services To use SQL Server R Services, you must install a collection of components to prepare a SQL Server instance to support the R distribution. In addition, each client workstation requires an installation of the R distribution and libraries specific to R Services. In this section, we describe how to prepare your environment to use R Services.

Articles in this issue

Archives of this issue

view archives of Netherlands: Software - Introductie van Micorosoft SQL Server 2016