I ran into a issue when trying to visualize a time series dataset. To align the data points with the corresponding X-axis labels, I found it helpful to use a “date” field that represents the end of the period (month, week, or day) rather than the beginning. This ensures that the data points are plotted at the correct position along the X-axis. First, I created a new field that represents the last day of the month for each record,weekend etc. ForWhen creating the visualization, I used the newly created date fields (month end, week end, or day end) as the X-axis values. Depending on the granularity of the data (month, week, or day), I formatted the X-axis tick labels accordingly. Now the issue is X-axis value and data point value is not matching.
Hi @Subbu
Can you share the calculated fields for the date and the amount field?
I suspect the group for the amount field is not aligned with your date field in the line chart
Regards,
Giri
This is the calculated reporting date column used in X-axis.
ifelse(
${granularity}=‘Day’,truncDate(“DD”,{reporting_date})
,${granularity}=‘Month’,addDateTime(-1, ‘DD’, addDateTime(1, “MM”, truncDate(“MM”, {reporting_date})))
,${granularity}=‘Week’,addDateTime(6, ‘DD’, truncDate(“WK”,{reporting_date}))
,truncDate(“DD”,{reporting_date})
)
Hi @Subbu
Your screen shot has Apr 30, Dec 31 which are end of months. But rest of the months have beginning of month.
Looking at your formula for Month granularity the formula looks right. But visual does not make sense.
Can you share some more details of the of visual from the field well ?
From the line chart, the X-axis aggreagtion is day which is correct. I don’t want aggregate to month because i have filter that customer can choose Month. Week as day granularity. So my requirment is X- should have May 31,2024 and show the May data point .
Hi @Subbu,
In your tooltip menu, why don’t you hide the field that’s showing the date, and then add in your calc. field as an option so that it matches your x-axis. Otherwise, the tool tip will always show your actual data that’s in the field (in this instance, June 30th).
Let us know if you have any additional questions or if you were able to find a different work around for your case.
If we do not hear back within the next 3 business days, I’ll close out this topic.
Thank you!
Hi @Subbu,
Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.
Thank you!