Okay
  Public Ticket #2761443
Number from String column
Closed

Comments

  • Simon started the conversation

    Hi, I want to use charts, but it seems that the input column needs to be numeric. The question is something along the lines of: "Can I use a calculated column to determine if a particular string exists in one column, and output 1 if it does, 0 if it does not?"

    Something like the following: 

    Column A = Apple, Orange, Apple, Apple, Orange
    Column B = "If(A = "Apple", 1, 0)
    Column B data will therefore be: 1,0,1,1,0 


    That way, if I set my chart on Column B I can show that the count of Apples = 3. 

    Even better if I could then group by A to show that Apples = 3, Orange = 2 or some other mechanism. 

  •  2,507
    Aleksandar replied

    Hello Simon

    I am sorry to disappoint you, but unfortunately, something like this is not possible with the plugin's built-in features.

    Conditional rules cannot be used between columns, so this would not work.

    Unfortunately, you will need to restructure this table, or create a custom SQL Query to build a new table showing that data, but creating custom queries is not included in the provided support for the plugin, so we wouldn't be able to help you with that.

    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