Why on some columns is the counting operation performed and on others the sum operation

Answered
Ignacio Sans asked on September 29, 2017

My query is more about using and functiong pivot tables. A customer consulted us
because on some numerical columns the count operation is applied and on others the sum operation, when in both cases they are numbers.

This is the example we are using and one of the attached image:
http://datos.energiaabierta.cl/dataviews/241686/consumo-electrico-por-comuna-y-tipo-de-cliente/?locale=en
In the first instance, I just need you to explain the reason for that difference.
Thanks and regards,
Gonzalo-Junar

Attachments:
pivot-tables.png

1 answer

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster October 2, 2017

Hello Ignacio,
Thank you for your question. The sum operation can be used only for the number fields. The result of this operation is the sum of all members of the field. The count operation can be applied both for the string fields and the number field. The result of the operation is the number of the members of the field. Also, we have a distinct count operation which counts the number of unique members of the field. You can find the list of all operations which are available for the current field in the configurator - https://www.screencast.com/t/FWARq4Ml9Z4X. Please note that if the values for the current field are set with strings and the data type is not defined the component will define it as the string. After that, the sum operation is no longer available for such field and even if the value looks like a number the component understands it as the string. For such cases, please set the data type explicitly with the appropriate data type (https://www.flexmonster.com/doc/managing-data-presentation-json).
Please let us know if you have any additional questions here.
Regards,
Dmytro.

Please login or Register to Submit Answer