How to use the type “month” in JSON Data Types

Answered

What does this type expect as input and what does it output?

I have tried it with several input values such as Datetime string or yyyy-mm-dd formatted date but none worked.

Same question for the weekday type.

5 answers

WebDataRocks Team WebDataRocks September 19, 2019

Hello Toky,
 
Thank you for the question.
month type can be used for string values such as January, February, etc.
When using month type, members of such hierarchy will be sorted correctly from January to December.
 
Same for the weeday, it works with Monday, Tuesday, etc.
 
Please let us know if it was helpful.
 
Regards,
WebDataRocks Team

Toky Ratefinanahary September 20, 2019

Thanks.
Didn’t think it was that simple. I overthought it.
Does the value have to match with the configured translation in the localization?

WebDataRocks Team WebDataRocks September 24, 2019

Hello Toky,
 
Yes, month and weekday values have to match the localization values.
 
Regards,
WebDataRocks Team

Om Dhanwant March 31, 2020
month type can be used for string values such as JanuaryFebruary, etc.

where should I set this `type` field , under which object ??
WebDataRocks Team WebDataRocks April 1, 2020

Hello,
 
Thank you for reaching out to us.
 
Specific types for hierarchies can be defined using the meta-object of the JSON or CSV data source. Such an object is represented as the first element of an array for JSON or the first row for CSV.
 
In case your data source is JSON, it is also possible to use the meta-object in order to create multi-level hierarchies and defining specific captions of the hierarchies.
 
We would like to kindly draw your attention to the following code snippets demonstrating the type definition:
JSON:

[{
"Revenue": {
type: "number"
},
"Month": {
type: "month"
}
},
{
"Revenue": 4678,
"Month": "January"
}
...
]

 
CSV:

-Revenue, m+Month
4768, January
...

 
More information about the meta-object and data types in our documentation:

We hope it helps.
 
Best regards,
WebDataRocks Team