DMX cross prediction query
-
2012年5月25日 上午 08:30
Dear All,
Below query is applying the total sales model to each store in dmx query but I am only able to do this for one store at a time . But I want to receive the predictions for 100 stores like 3000,3001,3002, ...,3022,....Where can I put this? I can only filter one store which is not practical.
Thank you
SELECT FLATTENED
([AllStores].[SUBE KODU]) as [Model Used],
('3022') as [AllStores],
(PredictTimeSeries([AllStores].[Ty Sales Unit],3, REPLACE_MODEL_CASES)) as [Predicted Quantity]
FROM
[AllStores]
PREDICTION JOIN
OPENQUERY([ForecastSales],
'SELECT
[WEEK]
,[STORE]
,[Ty Sales Unit]
FROM
dbo.[SalesByStore]
WHERE [STORE] =3022
' ) AS t
ON
[AllStores].[WEEK] = t.[WEEK] AND
[AllStores].[Ty Sales Unit] = t.[Ty Sales Unit]- 已移動 Darren GosbellMVP 2012年5月28日 上午 01:22 this is a dmx question (From:SQL Server Analysis Services)
所有回覆
-
2012年5月24日 上午 08:35
Dear All,
Below query is applying the total sales model to each store in dmx query but I am only able to do this for one store at a time . But I want to receive the predictions for 100 stores like 3000,3001,3002, ...,3022,....Where can I put this? I can only filter one store which is not practical.
Thank you
SELECT FLATTENED
([AllStores].[SUBE KODU]) as [Model Used],
('3022') as [AllStores],
(PredictTimeSeries([AllStores].[Ty Sales Unit],3, REPLACE_MODEL_CASES)) as [Predicted Quantity]
FROM
[AllStores]
PREDICTION JOIN
OPENQUERY([ForecastSales],
'SELECT
[WEEK]
,[STORE]
,[Ty Sales Unit]
FROM
dbo.[SalesByStore]
WHERE [STORE] =3022
' ) AS t
ON
[AllStores].[WEEK] = t.[WEEK] AND
[AllStores].[Ty Sales Unit] = t.[Ty Sales Unit]
- 已編輯 m2masari 2012年5月24日 上午 08:35
- 已編輯 m2masari 2012年5月24日 下午 03:05
- 已合併 Eileen ZhaoMicrosoft Contingent Staff, Moderator 2012年5月31日 上午 07:15 the same
-
2012年5月31日 上午 06:49版主
Hi m2masari,
I suggest you can try to use OR after WHERE in the query, please refer to the following article:
http://msdn.microsoft.com/en-us/library/ms132167.aspx
Thanks,
Eileen

