Data Mining Query returns ADOMDDataReader

Hello,

I created a Market Basket Data Mining Model with Association Rules, which I want to query and show in a Report. Everything works fine, when I preview the result in the Reporting Services Data tab I see some sort of table which I can expand and then see the related products.

Unfortunately this result seems to be an ADOMD Datareader which I cannot place in a table, matrix or textfield.

If anyone knows how I can make this Informationen available in my Report please let me know.

Thanks in advance



Answer this question

Data Mining Query returns ADOMDDataReader

  • edgtr

    Hello Robert,

    thanks a lot for your reply!

    Actually I did select Analysis Services as data source type and I created the query with the DMX designer.

    When I preview the result of the query i get something like this:

    Product | BasketPositions
    ____________________
    M-01 | + Expression
    M-02 | + Expression

    When I click on the "+" in front of BasketPositions I see something like this:

    Product | BasketPositions
    _____________________
    M-01 | M-10
    M-17
    M-34
    M-02 ....

    Now Fields!BasketPositions.Value is of Type Adomd.DateReader and I cannot place it in a table or similar. What do I do wrong

    My query looks like the following:

    SELECT

    t.[Product],

    [MarketBasket].[BasketPositions]

    FROM
    [MarketBasket]
    PREDICTION JOIN

    OPENQUERY([DB], 'SELECT [Product] FROM [dbo].[TmpSales]') AS t

    ON [MarketBasket].[BasketPositions].[Product] = t.[Product]


  • A L MA

    In report designer select "Analysis Services" as data source type. Then you can connect to data mining models directly through the DMX query designer.

    Datasets created this way can be used in RS reports the same way as other datasets.

    -- Robert



  • Kaanu

    You will need to change the DMX query so that it returns flat objects instead of data readers. I'm moving this thread over to the Data Mining forum - someone there may have suggestions how to write the DMX query to achieve the desired result.

    -- Robert



  • Fabiano Stussi Pereira

    Thanks a lot, that was exactly what I was looking for!!
  • Doutaz Michel

    You can use the FLATTENED clause to flatten out the nested table (the top level columns values will be repeated for each nested table row) like this:

    SELECT FLATTENED

    t.[Product],

    [MarketBasket].[BasketPositions]

    FROM
    [MarketBasket]
    PREDICTION JOIN

    OPENQUERY([DB], 'SELECT [Product] FROM [dbo].[TmpSales]') AS t

    ON [MarketBasket].[BasketPositions].[Product] = t.[Product]



  • Data Mining Query returns ADOMDDataReader