Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

group by clasue in mdx

$
0
0
Hi Friends i have small doubt in mdx query.table having data like belowtable name : patieninformationpn prcode dos Expected Payment MS0000003 PT001 1/2/2013 29.72 0 MS0000003 PT001 1/21/2013 57.1 0 MS0000003 PT002 6/7/2013 26.69 0 MS0000003 PT002 6/7/2013 89.16 0 MS0000003 PT002 6/6/2013 57.1 0 MS0000003 PT002 6/7/2013 12.28 0 MS0000003 PT002 6/7/2013 26.69 26.69 MS0000003 PT002 6/7/2013 89.16 77.16 MS0000003 PT002 6/17/2013 57.1 57.1Based on this table data i need to output like below pn prcode maxdos list of servicedays(max of dos-min of dos) Expected PaymentMS0000003 PT001 1/21/2013 19 86.82 0MS0000003 PT002 6/17/2013 11 358.18 160.98 maxdos means highest date based on prcode wiselist of service days : highet date from dos-least date from dos based on prcode wise.i tried in sql query select pn,prcode ,max(dos) as maxdos, max(dos)-min(dos) as list of servicedays frOM [RadianceBIStage].[dbo].[ledgertest2] group by pn,prcodesame way how to implement in mdx query.please tell me how to write mdx query to solve this issue

Viewing all articles
Browse latest Browse all 1341

Trending Articles