Hey everyone!

With the holiday season upon us, we want to share our upcoming working hours:

After that, we’ll return to our regular schedule and assist you as quickly as possible.

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.

Thanks a bunch for your understanding and support!

Warm regards and happy holidays!

TMS

Okay
  Public Ticket #3367721
New Table Creation
Closed

Comments

  • Michele Lucchetti started the conversation

    Hi mates, 


    Is there a way how to create a new table which is a query of another table already in place ? I have a main table with a number of columns. One of the column is related to REGION field. REGION field contains data such as REGION1 REGION2 REGION3 ..... etc. 

    I need to create a new table which is a subtable of the main one containing for example all the REGION1 fields. 


    Is that possible ? 


    Thanks 

  •  1,847
    Miloš replied

    Hi, Michele.

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    It depends on what is the original table type.

    For example, if you have a Manual Table, just check in the Editing tab, "MySQL Table Name",

    then you can easily call a new SQL Query table like :

    SELECT * FROM Table_Name

    You can add a "WHERE" SQL statement in the Query, like :

    SELECT * FROM Table_Name

    WHERE columnName= "REGION1"

    And that will only pull the rows that are "REGION1" from your desired column.


    There can also be different ways to pre-filter tables in our plugin :

    If you wish to try Pre-filtering tables through URL,  please check out this page with examples.

    -

    You can also use placeholders for table generation.


    1. For example, if you have a MySQL query-based table, you can use this query:

    SELECT * FROM yourDatabaseTable
    WHERE columnName = '%VAR1%'

    %VAR1% can be defined in the Placeholders tab when you're creating a table, 

    or you can pass VAR1 value in the table's shortcode.

    -

    For example if i have this Master Manual Table,

    and i want to make a dynamic SQL Table with VAR1 placeholder.  ( Then later i can input different VAR1 in the table shortcode on different pages).

    7428149389.png

    My example SQL Query for the table will be :

    SELECT * FROM wp_wpdatatable_44
    WHERE company = '%VAR1%'

    First, just to initially generate an SQL table with the VAR1 ,

    i will set the Cakewalk  company name in the VAR1 , in table's Placeholders tab :

    8172791691.png
    5335724844.png

    9566344767.png

    -

    Then, for example, if i want to make a different page for another Company,

     let's say "Adobe".  Then i pass that value in the VAR1 of the table shortcode :

    6925292908.png
    8863319507.png

    2. 

    Or, if you don't add the condition in an SQL query, you can add %VAR1% in column settings -> Filtering, under "Predefined filtering value".

    Then, you can have different versions of the same table, with the VAR1 value passed in the shortcode,

    let's say if we had a "Regions" column and we wish to filter a different region per each page.

    9385158392.png

    If we want page 1 for example only filtered for "Region A" , you can set predefined filter to this column as %VAR1% (filter type has to be set as text) :

    4266306375.png

    Then for a page where we need only Region 1 filtered, use shortcode [wpdatatable id=1 var1='Region A'] ,

    4565461533.png
    6779925578.png

     page 2 for only "Region B", shortcode would be [wpdatatable id=1 var1='Region B'] and so on, 

    to apply the values defined in the shortcode to the filter.

    ( This filtering method can be used for any table type, besides Simple Tables)

    -

    I also made a short video example - please check it out here.

    -

    Let me know if that helps or if you have any additional questions.

    Thanks.



    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  • Michele Lucchetti replied

    Hi Thanks a lot, I now fixed most everything. Only one thing is missing. In the filtered table I don't see duplicates which I see in the Master Table. 


    So for example 

    MASTER TABLE

    NAME

    REGION

    Michele

    Italia

    Michele

    Spagna

    Michele

    Italia

     

    Select * from MASTER TABLE where region=Italia

     

    SQL QUERY TABLE

    NAME

    REGION

    Michele

    Italia


    I want to see all the Italia Region Filed independently by the name. How can I do that ? 

    Thanks 


  •  1,847
    Miloš replied

    Hi ,Michele.

    My apologies, but i did not understand this use-case.

    Could you please elaborate more on what is the current result,

    and what will be the desired result, but if you can show us more details about your data set,

    tables, etc;

    if you can add some screenshots or even better record a Video that can summarize the use-case, 

    then we can advise?

    If the screenshots or Video have any sensitive data of your tables, please send them as "PRIVATE" reply, for security reasons.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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

  • Michele Lucchetti replied

    Hi, hope to find a way how to explain my issue better

    I have the following columns and test data in my MASTER TABLE which is the one I have to apply the SQL Query on. 

    NAME       REGION  
    Michele     Italy
    Michele     Spain
    Michele     Italy

    This is the query I want to apply on this Table Select * from MASTER TABLE where region=Italia

    My expectation is to receive the following 

    NAME       REGION  
    Michele     Italy
    Michele     Italy

    But it is not. What I receive is.  

    NAME       REGION  
    Michele     Italy

    I need to see all the lines where region is Italy even if the data in Name column are duplicated. 

    Thanks 


  •  1,847
    Miloš replied

    Hi, Michele.

    Can you try to add quotes around your searched value, like this :

    SELECT * FROM tableName
    WHERE region='Italy'

    Let me know if this helps?

    It works on my test table.

    6678470762.png
    8573020811.png


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    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