MDX cube views and string measures

Post Reply
User avatar
PavoGa
MVP
Posts: 622
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

MDX cube views and string measures

Post by PavoGa »

Looked, but did not find anything on this particular topic. Apologize in advance if one exists.

Looks like a TI that uses ViewCreateByMDX is unable to read string measures. SValue is not populated (well, it is populated with 0) and looks like the only way to retrieve a cell string value is by using CELLGETS.

Is it possible to construct the MDX in a way to force/convert a return of a string value?

Have also tried explicitly defining the data variable as string with the same result.
Ty
Cleveland, TN
User avatar
PavoGa
MVP
Posts: 622
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: MDX cube views and string measures

Post by PavoGa »

Okay, WITH MEMBER resolves this problem...

@jimnaff helped with this.
Ty
Cleveland, TN
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: MDX cube views and string measures

Post by lotsaram »

PavoGa wrote: Mon Jul 29, 2019 1:48 pm Okay, WITH MEMBER resolves this problem...

@jimnaff helped with this.
How exactly? Would be useful to post some example MDX.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
PavoGa
MVP
Posts: 622
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: MDX cube views and string measures

Post by PavoGa »

lotsaram wrote: Mon Jul 29, 2019 3:56 pm
PavoGa wrote: Mon Jul 29, 2019 1:48 pm Okay, WITH MEMBER resolves this problem...

@jimnaff helped with this.
How exactly? Would be useful to post some example MDX.
This code works in PAX and returns values as desired:

Code: Select all

SELECT 
    {    
    [lookup.Measure].[lookup.Measure].[Rollup Account Primary Name]
    }
    ON COLUMNS,
    NON EMPTY
    TM1SUBSETTOSET( [Accounts Master], "Distinct Accounts")  
    ON ROWS  
FROM [lookup.FPRP]
WHERE ([Version].[Active_01],
    [sys.Websheet Control].[Effective])

This code works in a TI. The TI will return the same values as the previous code, but in PAX does not return any values.

Code: Select all

WITH MEMBER [lookup.Measure].[lookup.Measure].[Rollup Account Test] AS
         [lookup.Measure].[lookup.Measure].[Rollup Account Primary Name]
SELECT
    {    [lookup.Measure].[lookup.Measure].[Rollup Account Test]    }
    ON COLUMNS,
    NON EMPTY
    TM1SUBSETTOSET( [Accounts Master], "Distinct Accounts") 
    ON ROWS  
FROM [lookup.FPRP]
WHERE ([Version].[Active_01],
    [sys.Websheet Control].[Effective])
    

This version returns blank values in PAX. Did not test, but expect this to work in TI returning values AND records with blank values.

Code: Select all

WITH MEMBER [lookup.Measure].[lookup.Measure].[Rollup Account Test] AS
         [lookup.Measure].[lookup.Measure].[Rollup Account Primary Name]
SELECT 
    {    
    [lookup.Measure].[lookup.Measure].[Rollup Account Test]
    }
    ON COLUMNS,
    TM1SUBSETTOSET( [Accounts Master], "Distinct Accounts") 
    ON ROWS  
FROM [lookup.FPRP]
WHERE ([Version].[Active_01],
    [sys.Websheet Control].[Effective])
    
Ty
Cleveland, TN
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: MDX cube views and string measures

Post by Wim Gielis »

Thank you !
I reproduced this on a small test cube with numeric and string measures and I can see that it works.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply