Question

I have two dimensions - Invoice_In and Invoice_Out. I need to create a new dimension Invoice which combines both of these. Is there any easy way to do this with a TI process (or any other way using TI or Performance Modeler)? Thanks.

No correct solution

OTHER TIPS

Have you consulted the Reference Guide (TM1 TurboIntegrator Functions chapter) about this?

You could use the All subsets of the two dimensions as a data source and iterate through both in the Metadata tab using two processes (or a master process which calls the same process and passes it parameters) but it would be just as easy (and more importantly you could keep it in one process by) doing this in the Prolog tab with a data source of None:

  • Use DimensionExists as an argument to an If() block to determine whether the dimension Invoice exists;
  • If it doesn't, use DimensionCreate to create it. Add any consolidations that you want to add using DimensionElementInsert statements.
  • Use the DimSiz Rules function to get the number of elements in Invoice_In and Invoice_Out and store both in variables;
  • Your first loop iterates through InvoiceIn using a While block to count from 1 to the DimSiz value.
  • In your loop you would obtain the existing element using DimNm(). (You will also need to use ElLev or DType if you want to obtain only the N level elements.) You insert each element into Invoice through DimensionElementInsert. You may also need to use DimensionElementComponentAdd to add it to any top level consolidation.
  • Your second loop would do exactly the same but for Invoice_Out.

Where you may run into issues is if you have the same element names in both dimensions. DimensionElementInsert won't spit the dummy over that but it will ignore the insertion when it's encountered the second time.

Do NOT call any other processes which are intended to refer to this new dimension in the Prolog. You need to cross the Metadata boundary to ensure that the new dimension is registered with the server.

Export both Elements, copy and paste both list into one sheet.

Use the sheet as a source then use one line of code DimensionElementInsert in your TI.

DimensionElementInsert(DimName, InsertionPoint, ElName, ElType);

Alternatively, use the existing dimensions as a source. Then you don't need to construct a file.

You can set the datasourcename and cycle through N amount of dimensions.

(note: The new dimension needs to exist. Or you can create a new dimension within your TI. Depends how much you want to code. But I gave you the solution with the least coding).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top