0
SO社區,MDX查詢返回不同的結果
我有我的BI應用程序的問題:
我必須建立在架構工作臺的模式,它完美的作品,準確地當我使用內置查詢測試儀。但是,從我的java應用程序調用時(我已經嘗試PreparedOlapStatement.execute()和OlapStatement.executeOlapQuery(String)方法),相同的模式返回完全相同的MDX查詢的不同單元格值。
只要執行語句,值就是錯誤的,所以我相信這不是我的應用程序的問題。我試着對查詢進行硬編碼,以確保它與我在工作臺中使用的相同,並且它仍然返回錯誤的值。
查詢如下,以因(一個相當愚蠢的)公司的政策改變了一些名字:
WITH
SET [SET1] as Filter(Filter1)
SET [T] as FILTER(FilterTime)
MEMBER Measures.[V] as SUM([T].item(0):Time.currentmember, Measures.[Measure1])
SET [Medida] as ({Measures.[V]})
SET [CJ] as ([ClassFin]*[Medida])
SELECT
[CJ] on 1,
[T] on 0
FROM [Cube]
假設如預期(因爲從架構工作臺我得到的結果是正確的過濾器工作,再次檢查底層數據庫),會出現什麼問題?
編輯:正在生成
兩個SQL查詢相同:
SELECT "td"."ano" AS "c0",
"td"."mes" AS "c1",
"fechamento_classificacao_financeira"."id_pai" AS "c2",
sum((CASE
WHEN sinal = 0 THEN vr
ELSE 0
END)) AS "m0"
FROM "util"."tempo_datas" AS "td",
(SELECT fc.classificacaofinanceira AS classfin,
fc.bempatrimonial AS bempat,
tt.id_pessoa AS participante,
tt.sinal AS sinal,
fc.centrocusto AS cc,
fc.data AS DATA,
fc.projeto AS pj,
fc.valorrealizado_recebimento vr,
fc.valorrealizado_pagamento vp
FROM financas.dadosanaliticosfluxocaixa fc
LEFT JOIN financas.titulos tt ON tt.id = fc.titulo) AS "fc",
"util"."fechamento_classificacao_financeira" AS "fechamento_classificacao_financeira"
WHERE "fc"."data" = "td"."data_completa"
AND "td"."ano" = '2017'
AND "fc"."classfin" = "fechamento_classificacao_financeira"."id_filho"
AND "fechamento_classificacao_financeira"."id_pai" IN ('8875114b-5dd3-4e5c-915f-55f91a825a74',
'cbae1877-9913-44b2-8533-f33a9a28ea31',
'e22fb59b-a6be-4d6b-a2de-8bb66b2b1b2a')
GROUP BY "td"."ano",
"td"."mes",
"fechamento_classificacao_financeira"."id_pai"
SO不讓我上傳並排查詢側的截圖,但我用一個diff檢查,以確認他們是一樣的。
如果您轉到tomcat/webapps/pentaho/WEB-INF/classes,您可以編輯log4j.xml以顯示由Mondrian發送到下劃線數據庫的SQL(取消對特殊日誌文件專用於Mondrian SQL語句「,並添加結果SQL與您的問題。做相同的架構工作臺。 – AlainD
@AlainD感謝您的評論。我做了這一點,並使用工作臺和我的應用程序的輸出差異檢查。是完全相同的,我會用信息和查詢更新問題。 –