Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

TSQL Code Snippet For Optimized Sales Query

SELECT
    'Customer'[Company Name], 
    'Date'[Date], 
    'Product'[Color],
    SUM ( 'Sales'[Quantity] )
FROM 'Sales'
    LEFT OUTER JOIN 'Customer' ON 'Sales'[CustomerKey] = 'Customer'[CustomerKey]
    LEFT OUTER JOIN 'Date' ON 'Sales'[OrderDate] = 'Date'[Date]
    LEFT OUTER JOIN 'Product' ON 'Sales'[ProductKey] = 'Product'[ProductKey];
Source by www.sqlbi.com #
 
PREVIOUS NEXT
Tagged: #TSQL #Code #Snippet #For #Optimized #Sales #Query
ADD COMMENT
Topic
Name
1+5 =