Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
How to add measures
posted

Hello

I have the following data structure:

Class1 has following properties: string1, string2, doule1, double2, class2.

Class2 has the following properties: string3, string4, double3, double4.

I create a FlatDataSource with the initial cube containing a List<Class1>. What I want, is to be able to expose double3 and double4 from class2 property of Class1 as measures. How can I do that??

FlatDataSource flatDataSource = new FlatDataSource()
            {
                ItemsSource = class1List,
                Cube = DataSourceBase.GenerateInitialCube("Class1"),
                Rows = DataSourceBase.GenerateInitialItems("[string1], [string2]"),
                Columns = DataSourceBase.GenerateInitialItems("[class2]"),
                Measures = DataSourceBase.GenerateInitialItems("double3")
            };

does not work. What am I doing wrong?

Many thanks

Kostas.

Parents
No Data
Reply
  • 640
    Verified Answer
    posted

    Hi

    to expose double3 and double4 from class2 property of Class1 as measures cannot be done directly. You can do this like in Class1 define two additional properties of type double double3Class2 and double4Class2. So constructing your FlatData  you can set to this properties values from object class2.double3 and class2.double4. In this way Measures will be created from double3Class2 and double4Class2 which are in Class1.

    I hope that this will help you.

    Dimitrina

     

     

Children