Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

How to compare column values

Luciano Carvalho asked on January 16, 2018

I have a question, but I do not know if it is possible to do it.
Company    |    Total 2017   |    Total 2018   | Result
Coca-cola    |    100.00        |    50.00          | 50.00
Pepsi          |     300.00        |   300.00         | 00.00
I can compare values by column / cell ?

3 answers

Dmytro Zvazhii Flexmonster January 17, 2018

Hello Luciano,
Thank you for your question. Please have a look at the following jsfiddle example – To achieve such behavior you need to pre-process data creating two separate fields (“Price-2017” and “Price-2018”) which should contain the appropriate sum value for each field. After that please create the new calculated field with such formula:
sum(\"Price-2017\") - sum(\"Price-2018\") .
Let us know if the suggested above works for you.

Luciano Carvalho January 17, 2018

The solution is pretty cool, however I’m using the type: dataSource: {dataSourceType: “ocsv”, filename: “api/controllerName/get”} not the type in JSON.

With the solution you passed me the prepareData did not work, the function was not called.

I am studying the documentation while I await your return.
Thanks for the attention!

Dmytro Zvazhii Flexmonster January 17, 2018

Hello Luciano,
Thank you for the update. In such case, we recommend running the data pre-processing on the server side. You can add two additional fields with the appropriate data before running the compression. After that, you will be able to use the suggested above approach. 
Let us know if you have any additional questions.

Please login or Register to Submit Answer