Okay
  Public Ticket #2590469
Conditional Formatting
Closed

Comments

  • Zak started the conversation

    Hi,

    When conditional formatting in a string cell, if i were to set the cell content to a number dependent on the contents of the cell, is it possible to then sum this column as it is now entirely populated with integers. An example is if the order is for Apples, I have conditionally formatted this cell to display the number '1' instead. However when I then try to sum this column it returns 0 as it was not an integer column to begin with. Is there any way to get around this? Ideally I'd like to add another column whereby I could conditionally format across columns however I don't believe this feature exists. 

    Please let me know.

    Many thanks,

    Zak

  •  2,572
    Aleksandar replied

    Hello Zak

    Unfortunately what you're looking for to achieve is not possible.

    What comes to mind is to add another integer column which will have the default editing value "1". Then, you would be able to include SUM for that Order column (and you can even hide the Item column).

    For example, the original table is:

    5997980384.png

    Then, you'd add "%VAR1%" as a predefined filtering value for the Item column:

    9212137060.png

    When displaying the table on front-end, you would use shortcode like [wpdatatable id=7 var1='Apple']:

    9553205501.png

    So, you would be able to change the placeholder through the shortcode, and have the Order column display total orders for that filtered column.

    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