T-SQL to MDX

  • Hi All

    I am new to writing MDX so please forgive my ignorance.

    I was wondering if anyone could recommend an easy way to convert T-SQL to MDX.

    I have this script below which I want to convert into a KPI to see how many calls where closed on or before the SLA date and build a gauge

    declare @a int

    declare @b-2 int

    --amount of closed calls

    select

    @a = COUNT(*)

    from

    IncidentDimvw

    where

    Status_IncidentStatusId = 3

    --amount of closed calls in side target resolution type

    select

    @b-2 = COUNT(*)

    from

    incidentdimvw

    where

    ResolvedDate <= TargetResolutionTime

    and

    Status_IncidentStatusId = 3

    select @a,@b

    select (@b*100) / @a

    Can anyone help in translating this to MDX or pointing me in the right direction?

    Thanks

    Ant

  • You may want to look at the kpi's in UI mode prior to trying to set them up using MDX. If you set up one or more this, you can script out the cube and view the MDX used to generate the KPI. MSDN covers how do to this (here).

    Steve.

  • MDX is as different from T-SQL as T-SQL is from procedural languages. While it's possible to "translate" T-SQL into MDX just as it's possible to "translate" procedural languages into T-SQL, it's just as wrong-headed.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • It seems like this would be trivial in any cube browser if you added a measure to the cube for calls with a

    "ResolvedDate <= TargetResolutionTime"

  • that was the problem, i didnt have a measure.

    i have created a new named query which generated the percentage value and mapped it to a measure and dimension to process the cube, then built the KPI around the measure and dimension.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply