Please help me to count specific values in a table.
I have some data in this form:
var data = {
"metadata": ["FZ", "CS", "CU", "CZ"],
"values": [
["CON", "184.0", "null", "null"],
["ERG SRL", "35.0", "null", "57.0"],
["IO", "6.0", "null", "null"],
["IND", "null", "1753.0", "null"],
["LIXL", "1644.0", "null", "3748.0"],
["MOXRL", "2285.0", "null", "0.0"],
["MOLXL", "11.0", "null", "0.0"],
["MURX", "5362.0", "null", "275.0"],
["STRL", "197.0", "null", "39.0"]
]
};
Here are the results on jsbin.
In that table I have some values like null, 0.0 and other.
All I want is to count this values on their key: EXAMPLE: This is my table:
FZ CS CU CZ CON 184.0 null null ERG 35.0 null 57.0 IO 6.0 null null IND null 1753.0 null LIXL 1644.0 null 3748.0 MOXRL 2285.0 null 0.0 MOLXL 11.0 null 0.0 MURX 5362.0 null 275.0 STRL 197.0 null 39.0
Here is the result I want:
CS CU CZ all 9 9 9 null 1 8 3 0.0 0 0 2 >0 8 1 4
The only result was when I count cell in generated tables, but this is not good if I want to have pagination.
I tried .length(), count++ based on several answers on stackoverflow.com, but no result.
Thank you all for hints and answers.