Extract Object Data from the column
Hi,
My data is in an Object in a column. I want to use that data to showcase in the Line chart. Currently I am using compose SDK to create a Line chart. Could anyone can help me to extract that data?
Column looks like this: {"sales": [1570.73, 1020.58]}. Want to extract the sales data.
Hi amitpatil, thanks for your question!
Based on the format of your data, it looks like you're not querying directly from a Sisense instance but using an external data source instead. In that case, you'll need to ensure your data is structured appropriately for the Line chart component.
Here’s a simple example, assuming you’d like to build a double Line chart (since you have two values per data point) plotted over time:
You can use standard JavaScript methods to extract and manipulate data from objects and arrays. Since your column contains objects like `{"sales": [1570.73, 1020.58]}`, you can access the sales data using something like `row.sales` (assuming each row is an object). You might want to look into `map()` to transform your dataset into the required format.
Hope this helps!Hey amitpatil ,
If the data is being pulled directly into the Sisense ElastiCube, you can apply the transformation using the Custom Code feature.
Custom Code Feature allows you to run a Jupyter notebook during the build process to transform the data, such as modifying the Object column, and return a DataFrame that can then be used in a Line Chart.Best regards