Okay
  Public Ticket #3692557
Calculations and handling negative numbers
Closed

Comments

  • Marco DeGennaro started the conversation

    I have a table and it does a calculation and if the number is negative I want it to be 0... I used conditional formatting to change it to 0 but the negative number is still used in the total and when I export it.  Is there a way to have the 0 used the total instead of the negative value.  I'm pulling data from a nested json and doing a calculation on one of the fields.. simple calc... field -60... if the number is less than 60 then i get a negative number which I would want to be 0 instead.   Any help would be appreciated....

  •  1,805
    Miloš replied

    Hi Marco,

    I am sorry, but I am not understanding exactly what you wish to achieve.

    Our calculations are going to take the value of a number in any cell exactly as it comes from your data source.


    It is not possible to 'transform'/change that number before it gets taken into account for a calculation or Formula column.

    For example, if you set a Conditional Rule and change the content of a cell value - this can not work for calculations of formula(s) because they will take the actual/underlying value before it gets 'transformed'.


    So if that is what you need, I am truly sorry to disappoint you, but we don't have a way to dynamically change any value which is negative coming from the data source and set it to be zero for calculations or Formula.


    But let me know if we misunderstood what is the goal.

    If so, please elaborate in more details, show us some screenshots or a Video, how is the source value looking, you can show a few values, then how you are using them in Total calculation versus how they should be for your desired use-case, etc.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [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