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!

Okay
  Public Ticket #2144751
MYSQL Data retrieval group concat filter
Closed

Comments

  • Richard Scholtens started the conversation

    Dear support,

    The table I created uses MYSQL code to retrieve text from the database. It retrieves values from multiple tables. These rows are referring to posts. Extra values are added from different tables with the post id as key. However, one table is called wp_levels which hold multiple values which are assigned to one post. I use GROUP_CONCAT to show all levels on one row. When I do this it also does it with the filter values. I want to show the values separate in the filter. 

    How do I do this?

    HOW IT IS NOW

    #####TABLE

    title      |     description      |     levels         |      date

    hello     |     world               |       A1, A2      |    01-01-2019

    bye       |     world                |       B1, B2     |    01-01-2019

    #### FILTER CHECKBOX

    A1

    A1, A2

    A2

    B1

    B1, B2

    B2

    HOW IT SHOULD BE

    #####TABLE

    title      |     description      |     levels                 |     date

    hello     |     world               |       A1, A2            |     01-01-2019

    bye       |     world                |       B1, B2         |     01-01-2019

    #### FILTER CHECKBOX

    A1

    A2

    B1

    B2


    #### IF B2 checked

    title      |     description      |     levels    |     date

    bye     |     world               |       B1, B2    |     01-01-2019

    #### MYSQL CODE AS IT IS NOW (NON RELEVANT CODE REMOVED)

    SELECT DISTINCT
        CONCAT('<a href="', wp_posts.`guid`, '">', wp_posts.`post_title`, '</a>') AS `Title`,
        wp_posts.`post_excerpt` `Description`,
        IFNULL(NULLIF(GROUP_CONCAT(DISTINCT wp_levels.`name` ORDER BY wp_levels.`name` ASC SEPARATOR ', '), ''), "Unspecified") `Levels`,
        wp_posts.`post_date_gmt` `Date`
    FROM wp_term_relationships
    INNER JOIN wp_posts ON wp_posts.`ID` = wp_term_relationships.`object_id`
    INNER JOIN wp_levels ON wp_levels.`post_id` = wp_posts.`ID`
    INNER JOIN wp_terms ON wp_terms.`term_id` = wp_term_relationships.`term_taxonomy_id` WHERE wp_term_relationships.`object_id` IN
        (SELECT DISTINCT wp_term_relationships.`object_id`
         FROM wp_term_relationships
         WHERE wp_term_relationships.`term_taxonomy_id`='19')
    GROUP BY wp_term_relationships.`object_id`

    I hope you guys can help me out.

    Sincerely,

    Richard Scholtens

  •  2,576
    Aleksandar replied

    Hello Richard.

    Thank you for your purchase.

    Can you access that column's settings, and go to Data. There, you should be able to change "Possible values for column" to "Define values list", where you could add these as individual values, so instead of "A1, A2, B1, B2, C1, C2" you can have "A1", "A2", "B1", "B2", "C1", "C2"...

    Please let me know if this works.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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

  • Richard Scholtens replied

    Hello Aleksandar,

    This was exactly the function I was searching for. I probably missed it because it was under Data instead of Filter. Thank you so much!


    Sincerely

    Richard Scholtens

  •  2,576
    Aleksandar replied

    You're welcome Richard

    Glad I could help.

    If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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