DMX Queries with MS Time Series

Hi!

I have a table Month_Sales(Month, product_1, .., product_n). The value of column product_i is the sale in this month.

so when i build MS Time Series for this domain, i want to query to find top m product is seld most in next month

How do i buid that query



Answer this question

DMX Queries with MS Time Series

  • Swami14425

    DMX doesn't provide a way to order by the forecast value. However, you should be able to easily do this in client side code. Assuming your model looks like this:

    CREATE MINING MODEL SalesForecast(
    Product TEXT KEY,
    Month LONG KEY TIME,
    Sales LONG CONTINUOUS)
    USING Microsoft_Time_Series

    The following query will return the prediction for the next month for all products:

    SELECT Product, Sales from SalesForecast

    You can sort the query result by Sales in client code and pick the top N..



  • DMX Queries with MS Time Series