Sequential Cluster Prediction Query

Întrebare Sequential Cluster Prediction Query

  • 16 iulie 2012 21:10
     
      Are cod

    I'm trying to use the SSAS Sequence Cluster model and I'm struggling with creating the code to predict future sequences. In the provided code below, I'm attempting to process new data through the model I developed, and I get the following error:

    Error (Data mining): An argument that is not valid is used in the PREDICTSEQUENCE function at line 2, column 19.

    I'd really like to use this model but I keep getting stuck in my efforts to generate predictions.

    Thanks.

    SELECT
      PredictSequence(contact_timeline,2)
    From
      [prospect_implant_pain_seq_mdl]
    PREDICTION JOIN
      SHAPE {
      OPENQUERY([proddb03_ew],
        'SELECT
          [source_system],
          [URINARY DYSFUNCTION/SACRAL NERVE STIM],
          [SPINAL PAIN],
          [MULTIPLE SCLEROSIS],
          [LUMBAR RADICULOPATHY],
          [RADICULAR PAIN SYNDROME(RADICULOPATHIES)],
          [Oral medications],
          [Physical therapy and/or chiropractic care],
          [contact_therapy_id]
        FROM
          [dbo].[contact_facts]
        ORDER BY
          [contact_therapy_id]')}
      APPEND 
      ({OPENQUERY([proddb03_ew],
        'SELECT
          [dimension],
          [time_sequence],
          [contact_therapy_id]
        FROM
          (SELECT DISTINCT ctt.contact_therapy_id, d.dimension, ctt.time_sequence
    FROM         dbo.contact_therapy_timeline AS ctt INNER JOIN
                          dbo.dimension AS d ON ctt.dimension_id = d.dimension_id
    WHERE     EXISTS
                              (SELECT     contact_therapy_id,       [source_system],
          [URINARY DYSFUNCTION/SACRAL NERVE STIM],
          [SPINAL PAIN],
          [MULTIPLE SCLEROSIS],
          [LUMBAR RADICULOPATHY],
          [RADICULAR PAIN SYNDROME(RADICULOPATHIES)],
          [Oral medications],
          [Physical therapy and/or chiropractic care]
                                FROM          dbo.contact_facts AS cf
                                WHERE      (ctt.contact_therapy_id = contact_therapy_id))) [contact_timeline]
        ORDER BY
          [contact_therapy_id]')}
        RELATE
          [contact_therapy_id] TO [contact_therapy_id])
        AS
          [contact_timeline] AS t
    ON
      [prospect_implant_pain_seq_mdl].[Source System] = t.[source_system] AND
      [prospect_implant_pain_seq_mdl].[URINARY DYSFUNCTIONSACRAL NERVE STIM] = t.[URINARY DYSFUNCTION/SACRAL NERVE STIM] AND
      [prospect_implant_pain_seq_mdl].[SPINAL PAIN] = t.[SPINAL PAIN] AND
      [prospect_implant_pain_seq_mdl].[MULTIPLE SCLEROSIS] = t.[MULTIPLE SCLEROSIS] AND
      [prospect_implant_pain_seq_mdl].[LUMBAR RADICULOPATHY] = t.[LUMBAR RADICULOPATHY] AND
      [prospect_implant_pain_seq_mdl].[RADICULAR PAIN SYNDROMERADICULOPATHIES] = t.[RADICULAR PAIN SYNDROME(RADICULOPATHIES)] AND
      [prospect_implant_pain_seq_mdl].[Oral Medications] = t.[Oral medications] AND
      [prospect_implant_pain_seq_mdl].[Physical Therapy Andor Chiropractic Care] = t.[Physical therapy and/or chiropractic care] AND
      [prospect_implant_pain_seq_mdl].[Contact Timeline].[Dimension] = t.[contact_timeline].[dimension] AND
      [prospect_implant_pain_seq_mdl].[Contact Timeline].[Time Sequence] = t.[contact_timeline].[time_sequence]



    Myles McKee