Converting single result of an MDX set query to a calculated measure -


i have set calculated member returns me first invoice date of specific client id. set uses currentsalesperiod single result generated set.

the problem want find workaround i'm not forced use set on rows. make measure can use in columns , other purposes.

could me that? possible @ in mdx? query below working use in query not allowed put on rows.

set [first invoice date]     iif(         count(             nonempty(                 [date invoice].[invoice date].[invoice date],                 [currentsalesperiod]                 * ytd(strtomember(@par_date).parent.lag(1).lastchild)                 * [point of sale].[client id].&[46]                 * {[measures].[ytd sales]}             )         ) = 0,         {[date invoice].[bonus calendar - week].[all].unknownmember.unknownmember},         head(             nonempty(                 [date invoice].[invoice date].[invoice date],                 [currentsalesperiod]                 * ytd(strtomember(@par_date).parent.lag(1).lastchild)                 * [point of sale].[client id].&[46]                 * {[measures].[ytd sales]}             ), 1         ) )   set [currentsalesperiod]     tail(          nonempty(             [point of sale].[management period].[management period],             {[measures].[sales amount]}             * ytd(strtomember(@par_date))             * [point of sale].[client id].&[46]         ), 1     ) 

pick dimension not going used, , tag on aggregated member aggregation of custom set - don't know cube try replacing [anotherdimension].[anotherhierarchy]. in following little used dim.hier in cube:

set [first invoice date]     iif(         count(             nonempty(                 [date invoice].[invoice date].[invoice date],                 [currentsalesperiod]                 * ytd(strtomember(@par_date).parent.lag(1).lastchild)                 * [point of sale].[client id].&[46]                 * {[measures].[ytd sales]}             )         ) = 0,         {[date invoice].[bonus calendar - week].[all].unknownmember.unknownmember},         head(             nonempty(                 [date invoice].[invoice date].[invoice date],                 [currentsalesperiod]                 * ytd(strtomember(@par_date).parent.lag(1).lastchild)                 * [point of sale].[client id].&[46]                 * {[measures].[ytd sales]}             ), 1         ) )   set [currentsalesperiod]     tail(          nonempty(             [point of sale].[management period].[management period],             {[measures].[sales amount]}             * ytd(strtomember(@par_date))             * [point of sale].[client id].&[46]         ), 1     ) member [anotherdimension].[anotherhierarchy].[agg_firstinvoicedate]     aggregate(       [first invoice date]     ) ... ... 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -