In my Bubble app database, I am storing the purchase history of customers in the following format:
Date: March 12, 2024, 9:45 AM
Purchase Amount: $500
and other information of purchases.
Now, I want to create two charts:
A line chart that shows the percentage of the total purchase count made on Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.
(Example - 40% on Monday, 17% on Tuesday, and so on…)
A line chart that shows the percentage of the total purchase count made during different hours of the day (1, 2, 3, 4, 5, and so on).
(Example - 12 % at 1 AM, 7% at 2 am, and so on…
Now, I am not able to understand how I can convert my date entries from the database to weekly days and hours of the day.
Can somebody please help me with this? Please consider me a newbie.
You’ll need to do a search for all your purchase history, and then use the aggregate and group functions on the data.
You’ll need 2 groups : group by day and by hour. And then some aggregations on the prices.
If it’s ok for you to use a translator on this page, I’ve made an example here of grouping and aggregation : Bubble | No-code apps
Pardon me, but I am either not able to understand what you are trying to communicate, or the solution doesn’t seem to be working.
Here is what I am doing:
For the Y-axis - I am conducting a search for purchases. Then, I am grouping by purchase amount and aggregating as count.
For the X-axis, I am again conducting a search for purchases. Then, I am grouping by date and aggregating as count, and formatting the final outcome as “ddd”.
However, this does not seem to be working.
Here’s what I am seeing in the UI.
system
Closed
June 18, 2024, 3:47pm
4
This topic was automatically closed after 70 days. New replies are no longer allowed.