Okay
  Public Ticket #3444876
questions on formula columns
Closed

Comments

  • Marcos started the conversation

    Hi

    I have some questions about formula columns:

    1. My table is a list of publications and each has a column for year and a column for month. I created a formula year*100+month for sorting purposes. I set the formula column hidden, but could not set the table to be sorted by this column. How do I sort the table by the hidden formula column ?

    2. How do I delete or edit an existing formula in the table

    3. can I make formula with string values ? (concatenation)

    Thanks

  •  1,857
    Miloš replied


    Hi Marcos,

    1. Sorry to disappoint you, but it is not possible to sort by a Formula Column,

    we do not have this possibility at the moment.

    If you wish to see this in the future,

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -


    I will elaborate what are the current possibilities to sort tables.

    if you wish to have the "sort by , then by another column" solution as well.

    -

    1. Regarding the "first, default" column -

     Each column has a “Default sorting column” switch in our Column settings/Sorting. 

    3693875442.png

    If you enable this switch for one of the columns, a selectbox will appear with options –

     “Ascending” and “Descending”, where you can choose the sorting direction . More about sorting with our plugin features you can read in our docs here - https://wpdatatables.com/documentation/table-features/sorting/

    2. - The only way users can sort the table by multiple columns with plugin's built-in functionality would be, 

    on the front-end, if you hold down SHIFT and click on the header of 2(or more) columns. ( for example column B, then C)

    Basically, this means that, after the table loads, a page visitor has to do this, 

    click on the C column whilst holding SHIFT(added the clicked column as a secondary, tertiary etc ordering column)."

    But, in case you need this to be "already done before the page loads",

     there is a custom workaround, with an SQL Query;

    we are not suggesting to use ORDER BY at all in queries, 

    because wpDataTables plugin is adding it dynamically based on what is set to be default sorting column.

    but if you disable the Sorting option for wpDataTable 

    6562202253.png

    and create wpDataTable from SQL query e.g:

    SELECT * FROM `my_table` ORDER BY ColumnB ASC, ColumnC ASC

    It will create and show wpDataTable with multi column sorting, but you will not be able to use Sorting anymore for this table.



    2. How do I delete or edit an existing formula in the table :

    - On the back-end of the Table, on each Formula Column you will see these two available buttons "edit" and "delete".

    5122439547.png

    If you click in the 'cog' button, you will see the Formula column settings.

    There you will be able to set up visual settings on Display tab,

    and on the "Data" tab, you will be able to edit the Formula.

    3486198414.png

    Please check more details explained on our Formula Columns here,

    and also we pointed out certain limitations on the page.


    3. No, you can only use Floats and/or Integer Columns as part of the Formula.

    String, or Date columns can not be used.

    Let me know if that helps.

    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

  • Marcos replied

    Thanks for the detailed answer.

    I added the requests in the suggestions page as you recommended.

    Marcos

  •  1,857
    Miloš replied

    Hi Marcos,

    Thank you for these requests, we will do our best to work on that as soon as possible.

    Please don't hesitate to open new tickets if anything else comes up.

    Thanks again.

    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