Define a field 2 times with 2 different data type

Resolved
Quan Hieu asked on December 15, 2016

Hi team, 
For example here I have a JSON data like this:

{
"Color":"red",
"M":"August",
"W":"Wed",
"country" : "Canada",
"state" : "Ontario",
"city" : "Toronto",
"Price":6829,
"Quantity":19,
"date" : "04/04/2016",
}

Could we define the date field 2 times with 2 different data type? Like this:

"date":{"uniqueName": "date", "type": "year/quarter/month/day", "caption":"Start of period", "dimensionUniqueName": "Date"},
 "date":{"uniqueName": "Date (Start of period)", "type": "date string", "caption":"Date (Start of period)", "dimensionUniqueName": "Date"}

Because now I see that it only get the second definition above. It means that I can only see the column "Date (Start of period)"

Many thanks.

2 answers

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster December 15, 2016

Hello Quan Hieu,
Thank you for the detailed explanation. Please note that when you are defining the fields they should be unique. When you are referring to the same field it will rewrite the previously created. The best way to achieve your goal is to duplicate the data under the separate field. It will look like the following:

{
   "Color":"red",
   "M":"August",
   "W":"Wed",
   "country" : "Canada",
   "state" : "Ontario",
   "city" : "Toronto",
   "Price":6829,  
   "Quantity":19,
   "date1" : "04/04/2016",
   "date2" : "04/04/2016"
}

Please, let us know if it works for you.
Best regards,
Dmytro.

Public
Quan Hieu December 16, 2016

Thanks Dmytro.

Please login or Register to Submit Answer