Dear all,
I have a table that contains:
cd_razao_tc(PK)
cd_so_razao_tc
desc_razao_tc
In the fact table, I use the cd_razao_tc column to make join and in the attribute, I display cd_so_razao_tc and desc_razao_tc columns.
The Microstrategy is executing the query like below:
select a11.CD_RAZAO_TC CD_TC,
a14.NM_RAZAO_TC NM_TC,
a14.CD_SO_RAZAO_TC CD_SO_RAZAO_TC,
a12.CD_MES CD_MES,
a13.NM_MES NM_MES,
sum(a11.QT_ICG_CGB) QUANTIDADEIN
from dw.TBDWF_ANALISE_CGB a11,
dw.TBDWD_PERIODO_DIA a12,
dw.TBDWD_PERIODO_MES a13,
dw.TBDWR_RAZAO_TC a14
where a11.CD_DIA_INCOMING = a12.CD_DIA and
a12.CD_MES = a13.CD_MES and
a11.CD_RAZAO_TC = a14.CD_RAZAO_TC
and a12.CD_MES in (200108, 200110)
group by a11.CD_RAZAO_TC,
a14.NM_RAZAO_TC,
a14.CD_SO_RAZAO_TC,
a12.CD_MES,
a13.NM_MES
and the results appears:
Metrics Quantity
Month Oct 2001 Aug 2001
Razão TC
60 COPIA RECEBIDA ILEGIVEL 0 202
72 SEM AUTORIZACAO 0 202
77 CARTAO INEXISTENTE 4 101
88 CARTAO VENCIDO 3 0
88 CARTAO VENCIDO 102 0
Note that cd_razao_tc is unique, but when i show the cd_so_razao_tc, display two rows with the same id and the same description. It occurs because in the GROUP BY CLAUSE, the Microstrategy puts cd_razao_tc too.
Someone knows how can i set to Microstrategy puts only cd_so_razao_tc and desc_razao_tc in the group by clause ?
Without cd_razao_tc in the group by clause (and select clause) the results appears like this:
Metrics Quantity
Month Oct 2001 Aug 2001
Razão TC
60 COPIA RECEBIDA ILEGIVEL 0 202
72 SEM AUTORIZACAO 0 202
77 CARTAO INEXISTENTE 4 101
88 CARTAO VENCIDO 105 0
Thanks,
I have a table that contains:
cd_razao_tc(PK)
cd_so_razao_tc
desc_razao_tc
In the fact table, I use the cd_razao_tc column to make join and in the attribute, I display cd_so_razao_tc and desc_razao_tc columns.
The Microstrategy is executing the query like below:
select a11.CD_RAZAO_TC CD_TC,
a14.NM_RAZAO_TC NM_TC,
a14.CD_SO_RAZAO_TC CD_SO_RAZAO_TC,
a12.CD_MES CD_MES,
a13.NM_MES NM_MES,
sum(a11.QT_ICG_CGB) QUANTIDADEIN
from dw.TBDWF_ANALISE_CGB a11,
dw.TBDWD_PERIODO_DIA a12,
dw.TBDWD_PERIODO_MES a13,
dw.TBDWR_RAZAO_TC a14
where a11.CD_DIA_INCOMING = a12.CD_DIA and
a12.CD_MES = a13.CD_MES and
a11.CD_RAZAO_TC = a14.CD_RAZAO_TC
and a12.CD_MES in (200108, 200110)
group by a11.CD_RAZAO_TC,
a14.NM_RAZAO_TC,
a14.CD_SO_RAZAO_TC,
a12.CD_MES,
a13.NM_MES
and the results appears:
Metrics Quantity
Month Oct 2001 Aug 2001
Razão TC
60 COPIA RECEBIDA ILEGIVEL 0 202
72 SEM AUTORIZACAO 0 202
77 CARTAO INEXISTENTE 4 101
88 CARTAO VENCIDO 3 0
88 CARTAO VENCIDO 102 0
Note that cd_razao_tc is unique, but when i show the cd_so_razao_tc, display two rows with the same id and the same description. It occurs because in the GROUP BY CLAUSE, the Microstrategy puts cd_razao_tc too.
Someone knows how can i set to Microstrategy puts only cd_so_razao_tc and desc_razao_tc in the group by clause ?
Without cd_razao_tc in the group by clause (and select clause) the results appears like this:
Metrics Quantity
Month Oct 2001 Aug 2001
Razão TC
60 COPIA RECEBIDA ILEGIVEL 0 202
72 SEM AUTORIZACAO 0 202
77 CARTAO INEXISTENTE 4 101
88 CARTAO VENCIDO 105 0
Thanks,