We're Moving to a New Support Platform – Starting June 1st!
We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.
You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.
While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.
We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.
Thanks for your continued support and trust – we’re excited to bring you an even better support experience!
Hello!
As I've seen others attempting this and it took me awhile to sort it out, I thought I'd share the solution we came up with regarding a Pivot table.
In our case, we used Advanced Custom Fields (ACF) and Custom Post Type to create a customer database capturing all services used by customers. As this data was stored in the postMeta table, we wanted a pivot table showing the customers across the top and services down the left.
As wpDataTables can't do Pivot tables natively, we opted to create a stored procedure and write the data to a new table. The table is updated each time the stored procedure is called (can be done with functions.php each time the page gets called). We will likely call this via some sort of cron script as the data does not change often.
Here is the code to create the stored procedure. Note that post_type = 'customer' is specific to our Custom Post Type. Also worth noting we changed the Y in the THEN ELSE meta value to display a large dot ⬤ but I kept it as a Y if that's what you would want to display.
I also created each of my ACF fields with a naming system that started with customer_ to make it easier to pull the data I wanted.
The resulting data gets written into a new table: customerServices. You can also change this to a different table if you like. This allows me to do a simple select * from customerServices with my wpDataTables query.
I also rotated the text of my customer columns to make nice clean columns. because the size of my table is large, I also froze the first column. Here's the CSS. I'm still doing some clean-up so I'm suspect some of the CSS needs a little attention yet.
Hopefully this helps! Also, this was not possible without a good friend and great developer to assist.
Screenshot sample:
Be well!
-Scott
Hey Scott, awesome, thank you for sharing this with everyone!
I am sure it will be of use to many users.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables