Related
I have a straightforward SQL statement that I posted into a DataFlow Task and got this dreaded error. There is no stored procedure or temp tables involved.
What am I missing?
The SQL works fine in SSMS and returns appropriate results. The query is pretty simple and I have never seen this error in SSIS before.
select cast([CREATE_DATE] as date) as create_date
,[SALES_DOCUMENT_NUM]
,[ORDER_LINE_NUM]
,[340b_id]
,[ALT_CHAIN_ID]
,[ALT_CUSTOMER_NUM]
,[BUYING_GROUP_NUM]
,[BUYING_GROUP_NAME]
,[COID]
, chain_id
,[CHAIN_ID_DESC]
,[CITY]
,[CURRENT_GL_CODE]
,[CURRENT_GL_DESC]
, [CUSTOMER_NUM]
,[CUSTOMER_NAME]
,cast(nullif([CUSTOMER_PACK_SIZE] ,'') as numeric(18,3)) as [CUSTOMER_PACK_SIZE]
,[DEA_NUM]
,[FORMULARY_ITEMS]
,[GLN]
,[HIN_NUM]
,[HISTORICAL_GL_CODE]
,[HISTORICAL_GL_DESC]
,[STATE]
,[STORE_NUM]
,[STREET]
,[TELEPHONE]
,[ZIP_CODE]
,[ABC_NUM]
,[ABC_6]
,[ABCHUN_IN_BLUEBOOK_FORMAT]
,[ABC_SELLING_UOM]
,[AHFS_THERAPEUTIC_CLASS_CODE]
,[AHFS_THERAPEUTIC_CLASS_DESC]
,[ABBREVIATED_DESC]
,[CORPORATE_ITEM_STATUS]
,[CORPORATE_ITEM_STATUS_DESC]
,[CURR_HUN_NUMBER]
,[DEA_CLASS]
, [DIVISION_STATUS]
,cast(isnull(nullif([FDB_PACKAGE_SIZE_QTY] ,''),0) as numeric(18,3)) as [FDB_PACKAGE_SIZE_QTY]
,cast(isnull(nullif([FDB_SWP_WHOLESALE_FACTOR] ,''),0) as numeric(18,3)) as [FDB_SWP_WHOLESALE_FACTOR]
,[FINE_LINE_CLASS]
,[FINE_LINE_CLASS_DESC]
,[FORM_CODE]
,[GCN]
,[GCN_SEQ_NUM]
,[GTIN_NUM]
,[GENERIC_DESC]
,[GENERIC_EXTENDED_DESC]
,[GENERIC_ABBREV_DESC]
,[GENERIC_FULL_DESC]
,[GENERIC_HICL]
,[GENERIC_PARENT_NUM]
,[HCPCS_CODE]
,[HRI_NUM]
,[HAZARD_CODE]
,[HAZARD_CODE_DESC]
,[ITM_CAT_CD]
,[ITM_CAT_DSC]
,[NDC]
,[OMP_ITEM_FAMILY]
,[OMP_ITEM_FAMILY_DESC]
,[OMP_ITEM_INDICATOR]
,cast(isnull(nullif([PACKAGE_SWP] ,''),0) as numeric(18,3)) as [PACKAGE_SWP]
,[PRICE_STICKER_RETAIL_QTY]
,[PRIMARY_INGREDIENT_HIC4]
,[PRIMARY_INGREDIENT_HIC4_DESC]
,[PRIVATE_LABEL_INDICATOR]
,[PRODUCT_CATEGORY]
,[PRODUCT_CATEGORY_DESC]
,[PRODUCT_DESCRIPTION]
,[PRODUCT_ENTERED]
,[PRODUCT_GROUP]
,[PRODUCT_GROUP_DESC]
,[PRODUCT_PRICING_CLASS]
,cast(isnull(nullif([SIZE_QTY],''),0) as numeric(18,3)) as [SIZE_QTY]
,[SWP]
,[SWP_DATE]
,[SINGLE MULTI_SOURCE]
,cast(isnull(nullif([STANDARD_UNIT_SWP] ,''),0) as numeric(18,3)) as [STANDARD_UNIT_SWP]
,[SUPPLIER_NUM]
,[SUPPLIER_MATERIAL]
,[SUPPLIER_NAME]
,[UPC_BARCODE]
,[UNIT_DOSE_CODE]
,cast(isnull(nullif([UNIT_SIZE_QTY] ,''),0) as numeric(18,3)) as [UNIT_SIZE_QTY]
,[UNIT_STRENGTH_CODE]
,[UNIT_STRENGTH_QTY]
,[CONTRACT_NUM]
,[CONTRACT_ABBREV_NAME]
,cast(isnull(nullif([CONTRACT_COST] ,''),0) as numeric(18,3)) as [CONTRACT_COST]
,[CONTRACT_EFFECTIVE_DATE]
,[CONTRACT_EXP_DATE]
,[CONTRACT_NAME]
,[CONTRACT_SALE_FLAG]
,[CREATED_BY]
,[CREDIT_REASON_CODE]
,[CREDIT_REASON_DESC]
,cast(isnull(nullif([CURRENT_ACQ_COST] ,''),0) as numeric(18,3)) as [CURRENT_ACQ_COST]
,[CUSTOMER_DEPT_NUM]
,[CUSTOMER_ITEM_NUM]
,[CUSTOMER_PO_NUM]
,[DISTRIBUTION_CENTER]
,[DROPSHIP_FLAG]
,cast(isnull(nullif([DRUG_FORM_COST] ,''),0) as numeric(18,3)) as [DRUG_FORM_COST]
,cast(isnull(nullif([EXCEPTION_QTY] ,''),0) as numeric(18,3)) as [EXCEPTION_QTY]
,cast(isnull(nullif([EXTENDED_WHOLESALE_COST] ,''),0) as numeric(18,3)) as [EXTENDED_WHOLESALE_COST]
,[HISTORICAL_CUSTOMER_ITEM__NUM]
,[INVOICE_NUM]
,[INVOICE_DATE]
,[INVOICE_DUE_DATE]
,[INVOICE_LINE_NUM]
,[INVOICE_MONTH]
,cast(isnull(nullif([INVOICE_PRICE] ,''),0) as numeric(18,3)) as [INVOICE_PRICE]
,[INVOICE_TYPE]
,[INVOICE_TYPE_DESC]
,[INVOICE_YEAR]
,[LAST_INVOICE_NUM]
,[LAST_PURCHASE_PRICE]
,[LAST_PURCHASE_DATE]
,[NARCOTIC_BLANK_NUM]
,cast(isnull(nullif([ORDER_QTY] ,''),0) as numeric(18,3)) [ORDER_QTY]
,[ORDER_SOURCE]
,[ORDER_SOURCE_DESC]
,[ORDER_TYPE_CODE]
,[ORDER_TYPE_DESC]
,[ORIGINAL_INVOICE_NUM]
,[PRICE_METHOD]
,[PRICE_METHOD_DESC]
,[PROCUREMENT_CODE]
,[PROCUREMENT_MESSAGE]
,[PROGRAM_CODE]
,[PROGRAM_CODE_DESC]
,cast(isnull(nullif([QTY_SHIPPED] ,''),0) as numeric(18,3)) as [QTY_SHIPPED]
,[REASON_CODE]
,[REJECTION_REASON_CODE]
,[REJECTION_REASON_DESC]
,cast([SHIP_DATE] as date)
,[SPCL_HANDLING_CODE]
,[SPCL_HANDLING_CODE_DESC]
,[SUBMITTED_BY]
,[SUBSTITUTION_CODE]
,[SUBSTITUTION_CODE_DESC]
,[SUPPLIER_CONTRACT_NUM]
,cast(isnull(nullif([TAX_AMOUNT] ,''),0) as numeric(18,3)) as [TAX_AMOUNT]
,cast(isnull(nullif([TOTAL_EXTENDED_COST],''),0) as numeric(18,3)) as [TOTAL_EXTENDED_COST]
,[WAC_WITH_NET_OVERRIDE]
,cast(isnull(nullif([WHOLESALE_COST] ,''),0) as numeric(18,3)) as [WHOLESALE_COST]
,[8 BYTE MATNR]
,[NDC NUMBER]
,[ITEM STS DESCRIP]
,[MATERIAL DESCRIP]
,cast(isnull(nullif([FDB PKG SIZE] ,''),0) as numeric(18,3)) as [FDB PKG SIZE]
,[AWF SELL FACTOR]
,cast(isnull(nullif([PKG METRIC SIZE] ,''),0) as numeric(18,3)) as [PKG METRIC SIZE]
,[GCN SEQ NUMBER]
,[GNC GROUP NUMBER]
,cast(isnull(nullif([ACQUISITION COST] ,''),0) as numeric(18,3)) as [ACQUISITION COST]
,[CONTRACT NUMBER]
,[CONTRACT NAME]
,cast(isnull(nullif([ORIG CONTRACT COST] ,''),0) as numeric(18,3)) as [ORIG CONTRACT COST]
,[CONTRACT EFF DATE]
,[CONTRACT EXP DATE]
,cast(isnull(nullif([ABC WAC COST],''),0) as numeric(18,3)) as [ABC WAC COST]
,cast([ABC WAC EFF DT] as date) as [ABC WAC EFF DT]
,cast(isnull(nullif([MSRP PRICE] ,''),0) as numeric(18,3)) as [MSRP PRICE]
,cast(isnull(nullif([CSRP PRICE] ,''),0) as numeric(18,3)) as [CSRP PRICE]
,cast(isnull(nullif([RETAIL PRICE],''),0) as numeric(18,3)) as [RETAIL PRICE]
,[LEGACY ITM NBR]
from dbo.ABC_Invoice_File_Staging inv
left join dbo.ABC_Catalog_File_Staging cat on cast(inv.CUSTOMER_NUM as numeric) = cat.account_number
and inv.CREATE_DATE between cat.filedate and cat.filedate+6
and inv.NDC = cat.[NDC NUMBER]
and inv.[ABC_NUM]=cat.[8 BYTE MATNR]
where inv.CREATE_DATE = '20191015'```
no column name
CAST([SHIP_DATE] AS date)
I have the following query
SELECT [Acct], [Customer], [Code], [Description], [Value], [Sale Person],
[Region], [Store Type], ISNULL([2016], 0) AS '2016', ISNULL([2017],0) AS
'2017'
FROM
(
SELECT CUCODE AS 'Acct', CUNAME AS 'Customer', STKCODE AS 'Code', STKNAME AS 'Description', SUM(OD_QTYORD) AS 'Packs Ordered'
, OD_GROSS AS 'Value', CUSORT AS 'Sale Person', LEFT(CUUSER1,3) AS 'Region', DATEPART(yyyy, OD_DATE) AS 'Year', OH_USER2 AS 'Store Type'
FROM STK_STOCK
INNER JOIN ORD_DETAIL ON STK_STOCK.STKCODE=ORD_DETAIL.OD_STOCK_CODE
INNER JOIN ORD_HEADER ON OD_ORDER_NUMBER=OH_ORDER_NUMBER
INNER JOIN SL_ACCOUNTS ON OH_ACCOUNT=CUCODE
WHERE STKCODE IN ('76958', '27225', '27221', '26962', '26959', '26961', '27226', '26963', '26960')
AND OD_QTYORD > 0
AND CUCODE != 'Z9997'
GROUP BY CUCODE, CUNAME, STKCODE, STKNAME, OD_GROSS, CUSORT, CUUSER1, OD_DATE, OH_USER2
) AS SourceTable
PIVOT
(
SUM([Packs Ordered])
FOR [Year] IN ([2016], [2017])
) AS PivotTable;
The output looks great but I want a subtotal for each 'Acct' and a Grand Total for the whole thing.
Can anyone help with this?
You can use group by grouping sets as below:
SELECT [Acct], [Customer], [Code], [Description], [Value], [Sale Person],
[Region], [Store Type], sum([2016]) as [2016], sum([2017]) as [2017] FROM
(
SELECT [Acct], [Customer], [Code], [Description], [Value], [Sale Person],
[Region], [Store Type], ISNULL([2016], 0) AS '2016', ISNULL([2017],0) AS
'2017'
FROM
(
SELECT CUCODE AS 'Acct', CUNAME AS 'Customer', STKCODE AS 'Code', STKNAME AS 'Description', SUM(OD_QTYORD) AS 'Packs Ordered'
, OD_GROSS AS 'Value', CUSORT AS 'Sale Person', LEFT(CUUSER1,3) AS 'Region', DATEPART(yyyy, OD_DATE) AS 'Year', OH_USER2 AS 'Store Type'
FROM STK_STOCK
INNER JOIN ORD_DETAIL ON STK_STOCK.STKCODE=ORD_DETAIL.OD_STOCK_CODE
INNER JOIN ORD_HEADER ON OD_ORDER_NUMBER=OH_ORDER_NUMBER
INNER JOIN SL_ACCOUNTS ON OH_ACCOUNT=CUCODE
WHERE STKCODE IN ('76958', '27225', '27221', '26962', '26959', '26961', '27226', '26963', '26960')
AND OD_QTYORD > 0
AND CUCODE != 'Z9997'
GROUP BY CUCODE, CUNAME, STKCODE, STKNAME, OD_GROSS, CUSORT, CUUSER1, OD_DATE, OH_USER2
) AS SourceTable
PIVOT
(
SUM([Packs Ordered])
FOR [Year] IN ([2016], [2017])
) AS PivotTable
) a
group by GROUPING SETS ( [Acct], [Customer], [Code], [Description], [Value], [Sale Person],
[Region], [Store Type] )
ORDER BY [Acct], [Customer], [Code], [Description], [Value], [Sale Person],
[Region], [Store Type];
Based on Kannan Kandasamy's reply I got this which worked beautifully:
SELECT (CASE
WHEN GROUPING([Acct])=0 AND
GROUPING([Customer]) = 1 AND
GROUPING([Code]) = 1 AND
GROUPING([Description]) = 1 AND
GROUPING([Sale Person]) = 1 AND
GROUPING([Region]) = 1 AND
GROUPING([Store Type]) = 1
THEN 'Total '+ [Acct]
WHEN GROUPING([Acct])=1 AND
GROUPING([Customer]) = 1 AND
GROUPING([Code]) = 1 AND
GROUPING([Description]) = 1 AND
GROUPING([Sale Person]) = 1 AND
GROUPING([Region]) = 1 AND
GROUPING([Store Type]) = 1
THEN 'Total'
ELSE [Acct]
END) AS Acct , ISNULL([Customer],'') AS 'Customer', ISNULL([Code],'') AS 'Code', ISNULL([Description],'') AS 'Description', SUM(ISNULL([Value],'')) AS 'Value', ISNULL([Sale Person],'') AS 'Sales Person',
ISNULL([Region],'') AS 'Region', ISNULL([Store Type],'') AS 'Store Type', SUM([2016]) AS '2016', SUM([2017]) AS '2017'
FROM
(
SELECT [Acct], [Customer], [Code], [Description], [Value], [Sale Person],
[Region], [Store Type], ISNULL([2016], 0) AS '2016', ISNULL([2017],0) AS
'2017'
FROM
(
SELECT CUCODE AS 'Acct', CUNAME AS 'Customer', STKCODE AS 'Code', STKNAME AS 'Description', SUM(OD_QTYORD) AS 'Packs Ordered'
, OD_GROSS AS 'Value', CUSORT AS 'Sale Person', LEFT(CUUSER1,3) AS 'Region', DATEPART(yyyy, OD_DATE) AS 'Year', OH_USER2 AS 'Store Type'
FROM STK_STOCK
INNER JOIN ORD_DETAIL ON STK_STOCK.STKCODE=ORD_DETAIL.OD_STOCK_CODE
INNER JOIN ORD_HEADER ON OD_ORDER_NUMBER=OH_ORDER_NUMBER
INNER JOIN SL_ACCOUNTS ON OH_ACCOUNT=CUCODE
WHERE STKCODE IN ('76958', '27225', '27221', '26962', '26959', '26961', '27226', '26963', '26960')
AND OD_QTYORD > 0
AND CUCODE != 'Z9997'
GROUP BY CUCODE, CUNAME, STKCODE, STKNAME, OD_GROSS, CUSORT, CUUSER1, OD_DATE, OH_USER2
) AS SourceTable
PIVOT
(
SUM([Packs Ordered])
FOR [Year] IN ([2016], [2017])
) AS PivotTable
) a
group by GROUPING SETS (( [Acct], [Customer], [Code], [Description], [Sale Person],
[Region], [Store Type]),([Acct]),());
I am having a hard time to identify (and fix) the grouping issue I have with the following query. My data has some Country fields blank and the query is ignoring them, only those with non blank values are converted to rows. I tried removing the country grouping but I get the error "You tried to execute a query that does not include the specified expression "Country" as part of an aggregate function". This is the query I have in Access:
TRANSFORM Count([passed courses].[Course Number])
SELECT [domain].[Account ID], [domain].[Account Name], [passed courses].[Learner Email Address], [passed courses].Category, [passed courses].Country, [passed courses].[Earliest Start_Date], [passed courses].[Latest End_Date]
FROM [Domain Master] AS [domain] INNER JOIN (SELECT d3.ID, d3.[Learner Email Address], d3.[Course Number], d3.[Transcript Status], d3.Domain, c2.Category, [passed levels].Country, [passed levels].[Earliest Start_Date], [passed levels].[Latest End_Date]
FROM
(SELECT [completed courses].[Learner Email Address], [completed courses].[Level], [completed courses].Category, [completed courses].[Completed Count], [completed courses].Country, [learner dates].[Earliest Start_Date], [learner dates].[Latest End_Date]
FROM
(SELECT [courses taken].[Learner Email Address], [courses taken].[Level], [courses taken].Category, Count([courses taken].ID) AS [Completed Count], [courses taken].Country
FROM
(SELECT d1.ID, d1.[Learner Email Address], d1.[Course Number], c1.[Level], c1.Category, d1.[Transcript Status], d1.Country
FROM [Data] AS d1
INNER JOIN [Courses] AS c1 ON d1.[Course Number] = c1.[Course Number]
)
AS [courses taken]
WHERE [courses taken].[Transcript Status] = "Completed"
GROUP BY [courses taken].[Learner Email Address], [courses taken].Level, [courses taken].Category, d1.Country
)
AS [completed courses]
INNER JOIN
(SELECT d2.[Learner Email Address], d2.Country, Min(d2.Start_Date) AS [Earliest Start_Date], Max(d2.End_Date) AS [Latest End_Date]
FROM [Data] AS d2
GROUP BY d2.[Learner Email Address], d2.Country
) AS [learner dates]
ON [completed courses].[Learner Email Address] = [learner dates].[Learner Email Address] AND
[completed courses].Country = [learner dates].Country
WHERE
([courses taken].Category = 'Sales') AND (
(([completed courses].Level = 1) AND ([completed courses].[Completed Count] >=5)) OR
(([completed courses].Level = 2) AND ([completed courses].[Completed Count] >=5)) OR
(([completed courses].Level = 3) AND ([completed courses].[Completed Count] >=1))
) OR
([courses taken].Category = 'Purchase') AND (
(([completed courses].Level = 1) AND ([completed courses].[Completed Count] >=5)) OR
(([completed courses].Level = 2) AND ([completed courses].[Completed Count] >=4)) OR
(([completed courses].Level = 3) AND ([completed courses].[Completed Count] >=1))
)
)
AS [passed levels]
INNER JOIN ([Data] AS d3 INNER JOIN Courses AS c2 ON ((d3.[Course Number] = c2.[Course Number])))
ON ([passed levels].Level = c2.Level) AND ([passed levels].[Learner Email Address] = d3.[Learner Email Address]) AND ([passed levels].Category = c2.Category)
) AS [passed courses] ON [domain].[Partner Domain] = [passed courses].Domain
GROUP BY [domain].[Account ID], [domain].[Account Name], [passed courses].[Learner Email Address], [passed courses].Category, [passed courses].Country, [passed courses].[Earliest Start_Date], [passed courses].[Latest End_Date]
PIVOT [passed courses].[Course Number];
Any help is appreciated!
What if you added a case statement into your query where if country = '' then return a unique GUID else return the Country column value and alias the case as Country
GUID function for access
You may need to wrap the whole query as a sub query to group by the Country aliased column though. This isn't tested, just a concept idea as I can't see any other way of grouping a country and ignoring blanks within the same select, or a less you did 2 selects and did a union instead.
Regards
Liam
I have the following query that gives me an extract (I am putting this into a CSV from my cube).
I want to show the Total of all NRx in a column as the first column NRx and the rest of the NRx columns should come up as they do now. I tried to add a SUM (Measures.NRx) to this, but it did not work
How do I get a total NRx column?
SELECT
NON EMPTY
CrossJoin
(
[Time Period].[Calendar].[Cycle Dt],
{
[Measures].[NRx]
}
)
ON COLUMNS,
NON EMPTY
{(
[Prescriber].[Prescriber Name].[Prescriber Name].Members
, [Prototype Alignment].[Tier Code].[Lilly Tier Code].Members
, [Prototype Alignment].[Territory Name].[Territory Name].Members
, [Prototype Alignment].[District Name].[District Name].Members
, [Prototype Alignment].[Division Name].[Division Name].Members
, [Prototype Alignment].[Area Name].[Area Name].Members
, [Market Product].[Product Group Nbr].[Product Group Nbr].Members
, [Market Product].[Product G Name Name].[Product G Name Name].Members
)} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM
(
SELECT
({
[Prescriber].[Ims Prescriber Id].&[011111]
}
,
{
[Time Period].[Cycle Dt].&[2008-10-03T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-10T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-17T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-24T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-31T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-07T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-14T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-21T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-28T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-05T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-19T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00]
}
) ON COLUMNS
FROM [Mart]
) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE,
FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
In the first Crossjoin, where you have
[Time Period].[Calendar].[Cycle Dt],
Try adding a reference to the All member of the Calendar hierarchy
{[Time Period].[Calendar].[Cycle Dt], [Time Period].[Calendar].[All] },
I have the following query that gives me an extract (I am putting this into a CSV from my cube).
I want to show the Total of all NRx in a column as the first column NRx and the rest of the NRx columns should come up as they do now. I tried to add a SUM (Measures.NRx) to this, but it did not work
How do I get a Total NRx column?
SELECT
NON EMPTY
CrossJoin
(
[Time Period].[Calendar].[Cycle Dt],
{
[Measures].[NRx]
}
)
ON COLUMNS,
NON EMPTY
{(
[Prescriber].[Prescriber Name].[Prescriber Name].Members
, [Prototype Alignment].[Tier Code].[Lilly Tier Code].Members
, [Prototype Alignment].[Territory Name].[Territory Name].Members
, [Prototype Alignment].[District Name].[District Name].Members
, [Prototype Alignment].[Division Name].[Division Name].Members
, [Prototype Alignment].[Area Name].[Area Name].Members
, [Market Product].[Product Group Nbr].[Product Group Nbr].Members
, [Market Product].[Product G Name Name].[Product G Name Name].Members
)} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM
(
SELECT
({
[Prescriber].[Ims Prescriber Id].&[011111]
}
,
{
[Time Period].[Cycle Dt].&[2008-10-03T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-10T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-17T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-24T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-31T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-07T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-14T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-21T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-28T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-05T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-19T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00]
}
) ON COLUMNS
FROM [Mart]
) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE,
FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
What if you made a calculated member before the SELECT query with something like this:
SUM ([Measures].[NRx], [Time Period].[Calendar].[Cycle Dt])?
Then just do:
SELECT
NON EMPTY [MYCALCMEMBER_SUM] * CrossJoin([Time Period].[Calendar].[Cycle Dt], {[Measures].[NRx]}) ON COLUMNS,