We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Calculate / CalcEngine / CalcQuick - tables directly from JSON

Thread ID:

Created:

Updated:

Platform:

Replies:

143375 Mar 17,2019 11:50 PM UTC Mar 18,2019 06:04 PM UTC jQuery 1
loading
Tags: ejCalculate
Marek Baranowski
Asked On March 17, 2019 11:50 PM UTC

Hello,

I'm evaluating Calculate module from Essential JS 1 as it seems to fit my use case. However I need an advice on the following:

"Use with Arbitrary Objects

Use CalcQuick to add calculation support to just about anything. You can register values or formulas using an indexer on the CalcQuick object. Following this, the act of retrieving a value through the CalcQuick indexing triggers the calculation."

(source: https://www.syncfusion.com/jquery/javascript-ui-controls/calculation-engine)

I wonder it if's possible to have a JSON data structure which contains a collection of tables, then have those tables included in CalcEngine so in the end I would be able to make a calculation like `= SUM(Sales[Q2])`, given that the input json contains table with name 'Sales' and corresponding 'Q2' column.

Is it possible without imperatively adding all tables from the input json to the grid? I would like to have something in a similar fashion as `new CalcBase.setKeyValue("foo", "123") => `= [foo] + 123`.


Mohanraj Gunasekaran [Syncfusion]
Replied On March 18, 2019 06:04 PM UTC

Hi Marek , 
 
Thanks for using Syncfusion product. 
 
To perform the calculation for column values when provide the column name, you could implement the getValueRowCol and setValueRowCol method. Please refer the following UG link, 
 
 
Calc quick indexer performed based on the keys and assigned value. By this support, we could not perform the range calculation. 
 
Please get back us if you need any further assistance on this. 
 
Regards, 
Mohanraj G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon