Pivot get clicked cell original data

Hi there webix team!
Is there any way to access raw data, that was used to calculate cell value?
Check this snippet:
https://snippet.webix.com/jndz2onc

I’m trying to access clicked item “$source” property, but it returns nine IDs, which is wrong. Only one data record is actually related to clicked cell, but for some reason it returns IDs for all cells in a row (for every column in a row).

P. S. Keep in mind that I’m on webix version 6.1

id contains row and column attributes.
try to use column to get required info.
https://snippet.webix.com/fawtwaca

Thank you very much for your reply.
Unfortunately this only gives the actual clicked cell value. What I need is raw data records that were used for aggregating that cell value.
So, for reference, when I click on cell with value 0.518 I expect to be able to get full data object : “{“name”: “Colombia”, “year”: 2005, “continent”: “South America”, “form”: “Republic”, “gdp”: 146.585, “oil”: 0.518, “balance”: -1.886}”
Do you know a way to do that?

as you can see, display value is the result of calculation of multiple data and is not related to single row.
to get all source rows check this
https://snippet.webix.com/ajubnwyu

I am aware that display value may be the result of calculation of multiple data. This depends on original data structure. In this specific example it actually IS related to one single row.

When I click on cell with value “0.518”, which is on intersection of “Columbia” row and “2005” column - I expect to have only one data record inside $source array:

“{“name”: “Colombia”, “year”: 2005, “continent”: “South America”, “form”: “Republic”, “gdp”: 146.585, “oil”: 0.518, “balance”: -1.886}”

Because this is the only data record that was used to calculate that cell value. But for some reason I get nine values inside my $source - one for each column. Which is wrong, since other eight values from 2006-2013 columns were not used for calculating the value of a cell from 2005 column.

yes, in your specific case the source is single row.
but in practice the source is multiple array.
and to get real source you need to implement a bit deeper logic.
check this
https://snippet.webix.com/34amtqr9

Thanks! That is a nice solution. However I still can not get why on earth $source contain IDs from different columns than the one clicked cell belongs to. It should contain only those data IDs, that were actually used to calculate clicked cell value…
It sounds for me as expected functionality that should be available from the box…

Hello @vitaliy_kretsul ,
In the example above, $source refers to a row, not a cell, that is why the ids are specified for each column of this row.
Unfortunately, now we will not be able to add the needed feature out of the box as from the version 9.0 Pivot works in a different way. So, in this case it is only possible to use the suggested solution.

@MariyaDemy thank you for your reply! That sounds interesting. Can you give me more info please? What is the fundamental difference in how pivot works starting from version 9.0? Will I be able to access cell-based source data if I upgrade to version newer version?
Thanks!

@vitaliy_kretsul ,
From version 9.0 the Pivot has been rewritten on Webix Jet for easier customization. Also, the calculations were moved to a separate module that returns the finished data.

Will I be able to access cell-based source data if I upgrade to version newer version?

I’m afraid, no. By the way, could you tell me what is the use case of this?

@MariyaDemy
Understood, thank you.

could you tell me what is the use case of this?

In my application data may content lots of fields that are not displayed in pivot. So it is possible to click on any cell and to drilldown into a regular table displaying all the data records that were used to calculate clicked cell value. It is very useful for further analysis of data - one may check what are the values of those other fields or how many records stands behind that cell etc.