Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
May I know how to send a calculated dimension in qlik config?
Usually, when sending the config to engine, we put the field name under qFieldDefs. In below code, it's SOMEFIELD.
{ "handle": 1, "method": "CreateSessionObject", "params": { "qProp": { "qInfo": { "qId": "", "qType": "HyperCube" }, "qHyperCubeDef": { "qDimensions": [ { "qNullSuppression": false, "qDef": { "qFieldDefs": [ "SOMEFIELD" ] } } ], "qMeasures": [], "qInitialDataFetch": [ { "qHeight": 10000, "qWidth": 1 } ] } } } }
However, I want to pass a calculated dimension, like the following:
AGGR(DISTINCT Rank(FIELD1,4,1),FIELD2)
I really don't have any idea where to put a calculated dimension. Please advise.
It should be sufficient to add a '=' character to the beginning of the string used for the qFieldDefs property. So instead of "SOMEFIELD" you could write
=AGGR(DISTINCT Rank(FIELD1,4,1),FIELD2)
Hmm... It should. What kind of error are you getting? I added a calculated dimension to the following example that illustrates how to use hypercubes in the .Net SDK:
That example produces a hypercube that is defined like this:
"qHyperCubeDef": {
... "qDimensions": [ {
... "qDef": { "qFieldDefs": [ "=Year(TimeStamp)&'-'&Month(TimeStamp)" ],
... } } ], "qMeasures": [ {
... "qDef": {
... "qDef": "Sum([Sales Amount])" } } ] }