Get Free Trial

Mapping object: dimension vs value

Serban Vasile asked on June 25, 2020

Now that the mapping object can be pushed separately from url…I am trying to master the mapping settings…
Maybe I am missing something…mapping object is recommended to be used instead of header row instructions for csv or metadata first section object for json…
I don’t see in the mapping object how to indicate the column is a dimension or a value.
For csv headers, the following is allowing to force the column definition 

  • + – the field is a dimension.
  • - – the field is a value.

What is the equivalent for the mapping object?
We need to force the type of the field because it seems that no matter what some columns are auto-evaluated to values…when switching to flat view, it’s annoying to have to see the totals being created even though you don’t want them.

3 answers

Vera Didenko Vera Didenko Flexmonster June 25, 2020

Hello, Serban, 
Thank you for writing to us. 
The equivalent for the mapping object is the following: 
If a field is a value, simply specify its type as "number".
If a field is a dimension, simply specify its type as "string"
For instance: 

mapping: {
"Room Number": {type: "string"},
"Price": {type: "number"}

The above configuration should make all members of the "Room Number" field to be interpreted as text even if they contain numbers. 
In contrast, the "Price" field’s members should be interpreted as numbers and calculations will be applied. 
Please let us know if this works fine for you.
Looking forward to your reply.
Kind regards, 

Serban Vasile June 25, 2020

Makes sense, thank you. Please add this detail to your documentation, it’s not obvious.
Especially now when we can start pointing to the mapping as a separate URL call…

Vera Didenko Vera Didenko Flexmonster June 25, 2020

Hello, Serban, 
Thank you for your feedback. 
We are glad to hear that you found the explanation helpful. 
Our team will review the corresponding documentation and make the needed adjustments.
As always, you are welcome to write to us in case of questions. 
Kind regards, 

Please login or Register to Submit Answer