cancel
Showing results for 
Search instead for 
Did you mean: 

Bypass import records based off date in records (Time Dim)

jzachar
New Contributor

How would I bypass import records where the time is not equal to the WF Time POV?

2 ACCEPTED SOLUTIONS

T_Kress
Contributor III

You can bypass records at the Data Source level.  You would need to add a complex expression to the Time dimension of the data source.  It could look something like this:

Dim WFTimeStr As String = api.CurrentDataClusterKey.TimeName
Dim FileTime As String = args.Value

If FileTime.XFEqualsIgnoreCase(WFTimeStr) = True Then
	Return args.Value
Else 
	globals.Bypass = True
End If

Test and see if you can get that to work.

 

 

 

 

Teresa C. Kress
Principal Delivery Manager Partner Enablement | OneStream Software

View solution in original post

You could use this to get the month:

Dim thisMon As String = WFTimePOV.Split("M")(1)

 

View solution in original post

5 REPLIES 5

T_Kress
Contributor III

You can bypass records at the Data Source level.  You would need to add a complex expression to the Time dimension of the data source.  It could look something like this:

Dim WFTimeStr As String = api.CurrentDataClusterKey.TimeName
Dim FileTime As String = args.Value

If FileTime.XFEqualsIgnoreCase(WFTimeStr) = True Then
	Return args.Value
Else 
	globals.Bypass = True
End If

Test and see if you can get that to work.

 

 

 

 

Teresa C. Kress
Principal Delivery Manager Partner Enablement | OneStream Software

you are correct that the code pulls in the WF time POV.  Unfortunately, the time in the file is year and month.  I could simply check month, but I get errors trying to substring the month out of the WF Time POV (2024M1, etc).  Instead of TimeName is there a way to simply pull the Month (I haven't had any luck finding it)?

You could use this to get the month:

Dim thisMon As String = WFTimePOV.Split("M")(1)

 

KarlT
Contributor II

Alternatively use the TimeDimHelper which has a variety of useful and reliable ways to do this.

Dim month As Integer = TimeDimHelper.GetSubComponentsFromName(WFTimePOV).Month

 

MarcusH
Contributor III

As @T_Kress says you can stop the records being imported through the Data Source. As this is the Time dimension it's not an audit problem; if it were another dimension I would not recommend this. An alternative is to bring in all the records and then Bypass them using Transformation Rules. The problem though is that the Time dimension only has OneToOne maps and you do not want to play around with the maps period by period. If you import the Time member into another dimension as well as the Time dimension itself you can then use a Mask rule with a Business Rule attached. The BR then gets the current POV and sets the result to Bypass if it's not the correct period. This other dimension that you use will not normally be used in the application eg UD7 always defaults to None. If you don't have an unused dimension, you can use a TransformationEventHandler to update the maps where the Time period is incorrect. Transformation Rules method is the better option.