Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor
5 years ago

Matrix load using a Connector DataSource

Originally posted by Cosimo Palmisano

4/26/2019

Matrix load using a Connector DataSource
I'm trying to setup a data source for matrix loading using a connector data source / query which returns 12 columns of data (M1 to M12). I've setup the data source to include 12 Time source dimensions with data type being Matrix DataKey Text. The source field for each time source dimension are fields P01 to P12 as shown in screenshot below.
Has anyone tried this? For the matrix field, how do I determine which time member the field is supposed to represent? Each time column is named P01 to P12 so would the Matrix Header Value Line be 0?

 

  • OSAdmin's avatar
    OSAdmin
    Valued Contributor
    Originally posted by Puja Patel

    If you put in the time period value in the 'Static Value' setting under Logical Expression and Override Settings, the system will know which time to use (e.g. 2020M1 for Period 1). If you want to make it dynamic to use year over year, change your Logical Operator to 'Complex Expression' and use the following:

    Dim sYear As String = TimeDimHelper.GetYearFromId(api.WorkflowUnitPk.TimeKey).ToString

    Return sYear & "M1"

     

    where you change Mx to the period for each of your Time Source Dimensions.