Need a special offer?Find out if your project fits.
+

How to Group the column by day/week/quarterly/year from date field of JSON data source.

Answered
Dama Ankaiah asked on August 30, 2020

Hi All,
Looks like its been answered in below link but I could not able to make it work.I subscribed for a trial and I’m testing flexmonster to look if it fits my need.
Link: https://www.flexmonster.com/question/how-to-use-a-date-or-year-month-with-elasticsearch/
MY Issue:I would like to group the date column based on interval mentioned like day/week/quarterly/year
I am using JSON data source with date field .I have attached the screenshot of sample program which i tried based on above link.I have mentioned "interval": "1w"  to group the date column into week.
Please suggest me right approach.If this approach is  right one then could you please provide a sample on this.
Regards,
Ankaiah
 
 
 
 
 
 
 
 

Attachments:
Sample.JPG

4 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster August 31, 2020

Hello, Anhaiah,
 
Thank you for contacting us.
 
Our team wants to draw your attention to the fact that the mentioned forum thread is dedicated to Elasticsearch data source.
In order to split the date on the multilevel hierarchy while using JSON as a data source, it is enough to specify the corresponding data type.
Data types should be specified within the Mapping Object. Please note that the mapping object is a property of the Data Source Object and should not be placed in a slice.
 
We have complemented your JSFiddle so that the "date" hierarchy is of the "year/quarter/month/day" data type.
You are welcome to check it out by the link: http://jsfiddle.net/flexmonster/cvbam9f1/.
 
Detailed information about data types in JSON can be found in our documentation.
 
We hope it works for you.
Please contact us in case other questions arise.
 
Kind regards,
Illia

Public
Dama Ankaiah September 2, 2020

Hi lllia,

In below example ,I could see the interval is working for only days.(ex:"interval": "100d").But interval  is not working in below cases.
Exmaple : http://jsfiddle.net/flexmonster/cvbam9f1/.
Issue: if we mention interval as  7d  to archive the every "week" functionality, then it takes start date as minimum date value of date field.For example,if my data source minimum date value is 02-09-2020(dd/mm/yyyy)then interval start from 02(Wednesday)/09/2020 to 08(Tuesday)/09/2020  etc.So it does not take interval as every Monday to Sunday.Same issue with other below cases too.
Case 1:"interval": "1week" (interval range => every Monday to Sunday)
Case 2:"interval": "1Month" (interval range => every month)
Case 3:"quarter": "1quarter" (interval range => every quarter)
Case 4:"year": "1year" (interval range => every year)
 
Could you please suggest on this?
Thanks,
Ankaiah
 
 
 

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 2, 2020

Hello, Ankaiah,
 
Thank you for providing us with details.
 
You are right about the fact that the minimum date from the data set serves as a starting point for the interval.
As for now, Flexmonster does not provide the possibility to group dates by calendar weeks, months, etc.
 
Instead, we recommend preprocessing your JSON data set and group the data by the desired interval. Next, the grouped data set can be passed to Flexmonster.
 
Our team hopes it works for your case.
Please contact us in case other questions arise.
 
Kind regards,
Illia

Public
Dama Ankaiah September 2, 2020

Thank you for the provided update

Please login or Register to Submit Answer