Data Dictionaries

After using the Legacy CSV loader in Opal, we got an error with our data dictionary. Following the suggestions we created a view from the table upload, and imported the data dict. In fact, all the column types were updated correctly. But for some reason, all values in the view were nulified.

At first I suspected it could be because the table/view have unique names, but updating the data dictionary with neither the table nor the view fixed the issue.

Hi,

Well, the CSV loader is not a legacy one, it is a “built-in” one. The other one is provided by a plugin.

It is not clear to me what you did. Either you set up a table, with the expected dictionary and then import the csv by refering this prepared table; Or you import the csv file like it is and then make a view form it, amending variables with the right value type and the labels if any.

Regards Yannick

Or you import the csv file like it is and then make a view form it, amending variables with the right value type and the labels if any.

The second one. That’s what we did.

The types were imported correctly but for example a ‘date’ that was in DD-MM-YYYY would be converted to a null. Integer Variables such as 1, 2, 3 were recognized as ‘integer’, but the values were changed to null.

What could have trigerred this?

Okay!

I have a hypothesis of what went wrong: I think I have applied a table dictionary on a View.

For sake of example let’s take a table Obj1 and a view newview.

When I download the dictionary from the view page like so

A 12 column excel file is generated.

And when I apply this to my view, all is fine. The types are preserved.

The issue was what happened when I instead tried to apply a Data Dictionary from a Table:

This excel not only has less columns (10) but also a different table name in the leftmost column.

And sure enough, when I apply this dictionary to the View all of the values are nullified.

We really encountered this issue when working in a team. There my collaborator would keep getting null values. If i understand correcly, the solution is to ensure that all collaborators have the same View name and that the dictionary is exported from/created for that View (and not necessarily the source table).

Is that correct?

You can apply a data dictionary to a view, but do not forget the “script” column that specifies how to transform the values for each variable. If this column is omitted the values will be null (because no derivation script is specified).

Regards
Yannick

1 Like

Ok, that makes sense.

And for the table column, do we still need to have them match between template and destination (table or view)?