ssas - Get count of invoices for last three months? -


thank all. mdx query , returns count of invoices generated on march 2015 , works charm!

    set [myset]      [customer].[store group].[store group] * {[measures].[sales #]}    member [measures].[setdistcount]      distinctcount([myset])  select    {   [measures].[sales #]   } on 0  ,non empty      [customer].[store group].[store group] on 1  (   select      {[calendar].[month].[march 2015]} on 0   [f1_salesbi] ); 

output like:

            sales # store 1     156 store 2      56 store 3     546 ... store 10     69 

but wish report this:

            march     february     january store 1     156       656          145 store 2      56        89           41 store 3     546       215          215 ... store 10     69        69           96 

for desired output, how supposed query? please me!

generate looks over-complicating situation maybe little simpler required:

select    {    [calendar].[month].[march 2015],    [calendar].[month].[february 2015],    [calendar].[month].[january 2015],   } on 0  ,non empty      [customer].[store group].[store group] on 1 [f1_salesbi] [measures].[sales #]; 

to make dynamic ever shows last 3 months in cube use tail function this:

select    tail([calendar].[month].[month].members,3) on 0 //<< i've assumed ok may need use [calendar].[month].members  ,non empty      [customer].[store group].[store group] on 1 [f1_salesbi] [measures].[sales #]; 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -