cancel
Showing results for 
Search instead for 
Did you mean: 

Data Imports

JakeBrown
New Contributor

I have currently set up a new data source and associated transformation rules (and allocated to the appropriate workflow). Data importing is correctly working for 2022 time period, however I am getting the following error in any other time period......

I have got the Scenario as 'Current Datakey' and Time as matrix datakey in my columns

Summary: No valid DataKeys (Scenario / Time) found in data source.  Review the source data load processing log and check one-to-one transformation rules to ensure that you have created proper Scenario and Time dimension rules for this data source.

 

Any ideas? I am assuming this might be one simple setting change somewhere 

10 REPLIES 10

Henning
Contributor

Hi Jake, do you have the time mappings in place for the time period you are loading data to? You probably have, but that is the first thing to check. Are you using the same scenario for the load that returns the error? If not, do you have a mapping set up for this? Also this, you probably have in place.
Other than that, a few screenshots and more details might help. 

Hi - I believe I have everything in place (as the import works perfectly fine for 2022, just not for any other year....

I have looked at the log and its generating the following error;

Time Outside Workflow View.............. 11

My Time generation is as follows (then M1,M2...etc in difference columns) 

Dim sYear As String = api.Parser.DelimitedParsedValues(2)

Return sYear & "M1"

Do you have more than one year in your load file? If so, did you set this to True?

Henning_0-1664380486190.png

 

Not got multiple years in my import 

Makes it more confusing the 2022 works fine, is just an issue any other year. Maybe my Year / Month importing value is not working correctly ?

It could be a lot of things, and with the very limited information that is provided here, it is hard to guess, as all we can do is assume. Sai did provide a good hint. The next step, once you ruled out the basics that I asked for (which we have to believe you are in place), you go step by step. Analyze what the difference is between the load that is working and the one that is not working. Make it simple, reduce it to a single row/column with one data cell only. Then write your string variables (and anything else for that matter) in the error log and check whether this is all as expected. It is similar to working on a huge jigsaw puzzle. Hard work and frustrating, but in the end diligence pays off and you will probably slap your forehead.

Sai_Maganti
Contributor II

Jake

Print the sYear to error log and see what you get. Sometimes there might be a space etc. I assume you have a transformation rule for all the time periods you're loading data to. Are you able to see any data rows in the log file?

Sai

Hi Sai 

We are reasonably new to OneStream.... Do you have any guidance on how to print the SYear to error log?

I think this is what is causing the issue as I have just enabled multi year loads and my file (when trying to load into 2019) imported into 2022. Therefore making my think my sYear formula is defaulting to 2022 on all import years

Jake

Jake

Add the following line after you declare the sYear. Then you can check what is being output in the error log.

brapi.ErrorLog.LogMessage(si, sYear)

Sai

Thanks Sai 

Looks like it is generating 2022 (irrespective of what workflow year I am in). Any ideas?

The below is what I have to generate the year from the workflow...

Dim sYear As String = api.Parser.DelimitedParsedValues(2)

Return sYear & "M1"

Jake

It is doing what you asked it to do. i.e., api.Parser.DelimitedParsedValues(2) is the Year from a row in your source data which is column 3.

If you are looking to get the Year value from the workflow then use the following code:

'Get Workflow Year
Dim myWorkflowUnitPk As WorkflowUnitPk = BRApi.Workflow.General.GetWorkflowUnitPk(si)
Dim wfYear As Integer = BRApi.Finance.Time.GetYearFromId(si, myWorkflowUnitPk.TimeKey)
Dim sYear as String = wfYear.ToString()

 Sai