Hello Everyone ,
There are Sales Dataset.
I need cumulative sales by hour for current date and average cumulative sales by hour for last 7 days.
So I want to show parallel line in Line chart
the first line is for cumulative sales by hour for current date and
the second line is for average cumulative sales by hour for last 7 days.
To create the cumulative sales by hour for the current date you will need to create a calculated field which first filters for the current date:
(truncDate('DD', now())).
Then you can use the sumOver() function to get the cumulative sum by hour.
Similarly, to get the average cumulative sales by hour for the last 7 days you would make another calculated field which filters for the last 7 days:
(truncDate('DD', addDateTime(-7, 'DD', now())))
Then you can use both the avgover() and sumOver() functions to get the average.
Once you have these fields, you can create a line chart and use the hour of day for the X-axis and the calculated fields to the Y axis to get the desired parallel lines.
Hi @ThawZin,
It’s been awhile since we last heard from you; did you have any additional questions or did the solution provided above help with your case?
If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.
Hi @ThawZin,
Did you try out Arnavv’s suggestion posted above and did it not work for your case? If so, what part did not work or are you having trouble with?
Hi @ThawZin,
It’s been awhile since we last heard from you, if you are still in need of additional assistance, please provide additional information per my previous comment.
If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.
Hi @ThawZin,
Since we haven’t 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.