Question
Newlyn Erratt · May 1, 2020

How do I handle nested data in Intermediate Expressions?

As the title mentions, I'm trying to determine how best to handle an issue with nested data.  Essentially I have a setting like the following:

Object A has a transient property with an array of Object B. I want to create a level with a list of Object B.  I also want this level to contain properties belonging to each object B. 

So I have a layout of something like

  1. Dimension:ObjectBD
    1. Level: Object B is list
      1. Object B property 1
      2. Object B property 2

Since this is transient I can't use the usual property configuration mentioned in the developer tutorial.  What I'm trying to do is something along the lines of creating a list of lists  via  an Intermediate expression where each element in the outer list is one Object B and each element of the inner lists is something like $LISTBUILD(objb.prop1, objb.prop2).  The issue I'm coming across is that I do not know how I would handle the sourceExpressions for this.

 

I am also unsure if this is the correct way to even approach the problem as I'm learning a lot of things all at once (ObjectScript, our data model, Analytics, OLAP cubes in general) but my requirement is that this be isolated to the cube rather than modifying the base classes.

 

Any help or resources would be appreciated!

0
0 158
Discussion (1)1
Log in or sign up to continue

I'm not sure I completely understand your question but one thing I have had to use recently is found here https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=D2MODEL_prop_for_list

I had a level which was a list and I too wanted to define properties for the level, the property would be for each element of the level/list.  In my case I defined my level to run off of an expression where my expression returned a list of values.  Then for my property definition, I used an expression as well.  In the expression, I called a method passing %value.  

Hope this gives you something to go on.