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
765
How can I use string values as Measures?
posted

Hello,
I create a new message with a meaningful title.

My problem are values as string, which I need as Measures.
    
In my example (see attached) is that the column "EK [ml/g]" with the values "<4.98E-05", "1.07E-06" or ">3.07E-07".

Now I have looked for a solution in the forum or in "Features & Samples". But I can't find a solution for the problem.
Therefore in the annex my example (DataTable with values and FlatDataSource).
It would be very good if somebody helps me:

1. I need the column (type string) "EK [ml/g]" for Measures.
2. The column (type int) "TestNo" not displayed as Measures.

 


I would appreciate about example code.

Thanks.

Alexander 

PivotGridUserControl.zip
Parents
  • 7922
    posted

    Hi

    You should use cube settings to discribe your dimension metadata.

    flatDataSource.DimensionsGenerationMode = DimensionsGenerationMode.Mixed;
     
    CubeMetadata cm = new CubeMetadata { DataTypeFullName = dynamicType.FullName };
    DimensionMetadata dmd = new DimensionMetadata
    {
        SourcePropertyName = "TestNo",
        DimensionType = DimensionType.Dimension,
        DisplayName = "Test No",
    };
     
    cm.DimensionSettings.Add(dmd);
     
    dmd = new DimensionMetadata
    {
        //GroupName = "group",
        SourcePropertyName = "EK [ml/g]",
        DimensionType = DimensionType.Measure,
        DisplayName = "EK measure",
            AutoGenerateField=true, Aggregator= new CountAggregator()
        //Aggregator = new CustomMeasureAggregator(this._flatSource)
    };
     
    cm.DimensionSettings.Add(dmd);
                
    flatDataSource.CubesSettings.Add(cm);

    You can hide the TestNo when you set its DimensionType to measure. About  EK[ml/g] you shoud set its agregator, because the control should know how to deal with strings inside it.

    Regards
    Todor

     

Reply Children