PDA

View Full Version : How make mdx Query with parameters.



jlg29387
04-29-2014, 03:21 AM
Hello,

I want to make a mdx query with parameters. I have a component check, which I have assigned a parameter, which keeps its value. Then I have a text component in which I have a mdx query, which shows a table with a number of fields, what I want is to use the parameter check in mdx query to detect that items have marked and show only those are marked.

In SQL the query will be this:
SELECT d.VALOR, p.VALOR, i.UMBRAL, i.NCS, i.MUESTRAS_MINIMAS, a.VALORFROM IND_VALIDADA i JOIN DIM_SERVICIO d JOIN DIM_PRIORIDAD p JOIN DIM_EXENTA_ANS a
WHERE d.ID = i.ID_SERVICIO AND p.ID = i.ID_PRIORIDAD AND a.ID = i.ID_EXENTA_ANS AND d.VALOR in (${vservicio})
ORDER BY i.ID


In MDX the query that show all fields is this:
SELECT
{Hierarchize({{[Measures].[UMBRAL], [Measures].[NCS], [Measures].[MUESTRAS_MINIMAS], [Measures].[TOTAL], [Measures].[PORCENTAJE_CUMPLEN_ANS], [Measures].[DESVIO]}})} ON COLUMNS,
Hierarchize(Union(CrossJoin({[DIM_SERVICIO.SERVICIO].[PS: Alta Sistema]}, [DIM_PRIORIDAD.PRIORIDAD].[PRIORIDAD].Members), Union(CrossJoin({[DIM_SERVICIO.SERVICIO].[PS: Correctivo]}, [DIM_PRIORIDAD.PRIORIDAD].[PRIORIDAD].Members), Union(CrossJoin({[DIM_SERVICIO.SERVICIO].[PS: Evolutivo]}, [DIM_PRIORIDAD.PRIORIDAD].[PRIORIDAD].Members), Union(CrossJoin({[DIM_SERVICIO.SERVICIO].[PS: Oficina InformaciĆ³n]}, [DIM_PRIORIDAD.PRIORIDAD].[PRIORIDAD].Members), Union(CrossJoin({[DIM_SERVICIO.SERVICIO].[PS: Requisitos]}, [DIM_PRIORIDAD.PRIORIDAD].[PRIORIDAD].Members), CrossJoin({[DIM_SERVICIO.SERVICIO].[PS: Soporte]}, [DIM_PRIORIDAD.PRIORIDAD].[PRIORIDAD].Members))))))) ON ROWS
FROM [RECEPCION]

Thanks.