Cube.js: Generating Schema (Measures and Dimensions) dynamically ?

Created on 4 Nov 2019  路  5Comments  路  Source: cube-js/cube.js

Is there any way to create measures and dimensions dynamically in cube js schema ?
For example if i want to request data as the dataset is dynamic so all the measures and dimensions cant be defined in the schema.
For example if i have a measure of Power in my dataset and i want to get the sum, avg , max and min etc of Power than i have to manually add all the measures corresponding to the single state and lets suppose if i have many others measures like Energy, Voltage and Current and other 100's of states then adding manually measures and dimensions for all the operations will be very hectic depending on the dataset.
So is there anyway to implement the above mentioned scenario in cube js ?

question

All 5 comments

@paveltiunov Kindly guide me about this scenario.

@MuhammadMattiullah Hey Muhammad! Yep. It's possible. Here're some docs on it:
https://cube.dev/docs/schema-generation
https://cube.dev/docs/schema-execution-environment

@paveltiunov Thankyou very much for your response.
Looking into the above provided solution.

Successfully implemented the dynamic schema using the reference of above link. Thankyou @paveltiunov for the support.
I am closing the issue

Great to hear that!

Was this page helpful?
0 / 5 - 0 ratings