Forum Discussion

KK2012's avatar
KK2012
New Contributor III
2 months ago

Data Import Error: No valid DataKeys (Scenario / Time) found in data source

 

Hi All,

I'm encountering an error while trying to import data:

"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."

I've attempted both options for the time dimension—applying 'Datakey Text' and then assigning the Time field, as well as using the 'current Data key time' options—but it’s still not working.

For reference, I've attached the relevant code:

```csharp
var fields = new List<string>
{
"ACCOUNT",
"ACTUAL",
"Time"
};

return fields;

string wfYear = TimeDimHelper.GetYearFromId(api.WorkflowUnitPk.TimeKey).ToString();
int wfMonth = TimeDimHelper.GetSubComponentsFromId(api.WorkflowUnitPk.TimeKey).Month;
string periodName = $"{wfYear}M{wfMonth}";

var sql = new StringBuilder();
sql.Append("SELECT ");
sql.Append("ACCOUNT, ");
sql.Append("ACTUAL, ");
sql.Append("Time ");
sql.Append("FROM [tablename] ");
sql.Append("WHERE Time = '" + periodName + "';");
```

If anyone has faced a similar situation or has suggestions, I would greatly appreciate your input. Thank you!

  • Thank you, All. I have fine-tuned the connector BR and DS fields, now data is coming correctly. I really appreciate your response and time on this issue. 

  • KK2012's avatar
    KK2012
    New Contributor III

    Thank you, All. I have fine-tuned the connector BR and DS fields, now data is coming correctly. I really appreciate your response and time on this issue. 

  • sameburn's avatar
    sameburn
    Contributor II

    Hi KK2012 this is a generic error that means your data source is not reading any data

  • DanielWillis's avatar
    DanielWillis
    Valued Contributor

    Try clicking this button. It should hopefully tell you why records were rejected

     

  • matt515's avatar
    matt515
    New Contributor III

    I've had this issue before and in my case, I didn't have the amount field defined in the data source settings. Not sure if that's related to your issue but something you could check.