Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I am trying to define a hyper cube, and I want to set a calculation condition on a measure. Right now I have the following:
{
"qDef": {
"qLabel": "Foo",
"qGrouping": "N",
"qDef": "Bar",
"qNumFormat": {
"qType": "F",
"qnDec": 2,
"qUseThou": 0,
"qFmt": "0.0%",
"qDec": ".",
"qThou": ","
},
"autoSort": true,
"cId": "JXKjkd",
"numFormatFromTemplate": true,
"isCustomFormatted": false
},
"qSortBy": {
"qSortByNumeric": -1,
"qSortByLoadOrder": 1,
"qExpression": {}
},
"qCalcCond": {
"qv": "0"
},
"qCalcCondition": {
"qCond": {
"qv": "0"
},
"qMsg": {}
}
},
...
]
I have other measures in my hypercube definition, but I'm setting the calc condition of this one to 0 to see if I can get it to stop displaying.
I'm trying to create a pivot table with measures that will not calculate based on a variable I pass to qHyperCubeDef. However, when I set this measure to 0 to not calculate, the entire pivot table does not calculate. I get the following error in my console: "TypeError: Cannot read property 'qError' of undefined".
If I exclude "qCalcCond" and "qCalcCondition", the pivot table works fine, but it still displays the measure I don't want it to.
Am I just using qCalcCond wrong?
Does anyone have any insight into this?
does anyone found any solution on this, i am also looking for same issue.
Wow I posted this a while ago. Since then I have been able to disable pivot table measures. I'm not sure if it is something that I did or if it was fixed in a patch or something, but I haven't had any issues doing this since I posted this question.
It might be that I was passing the number 0 when you need to pass the string "0", but I honestly don't remember if I had tried that when I posted this.
Hi,
Can you please tell me how to give an expression in qCalcCond? I want to use this property to stop calculation of my hypercube if all of the given filters are not selected. Is it possible to write something like below in qCalcCond?
Getselectedcount(filter1)>=1 AND Getselectedcount(filter2)>=1
Could you help me with the syntax
Try this:
"qCalcCond": {
"qv": "=if(GetSelectedCount(filter1) >= 1 and GetSelectedCount(filter2) >= 1, 1, 0)"
},
"qCalcCondition": {
"qCond": {
"qv": ""
},
"qMsg": {
"qv": ""
}
}
not working still, tried with quotes, without quotes
return {
initialProperties: {
qHyperCubeDef: {
qDimensions: [],
qMeasures: [],
qInitialDataFetch: [{
qWidth: 50,
qHeight: 100
}],
qCalcCond: {
qv: "=GetSelectedCount(Currency) >= 1"
},
qCalcCondition: {
qCond: {
qv: ""
},
qMsg: {
qv: ""
}
}
}
},
definition: props,
snapshot: {
canTakeSnapshot: true
},
paint: function ( $element, layout ) {
.......