Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
could you help me a little bit with following task?
I have to create 3 values (Energy cost, Penalty, Reserved capacity) two of them should be calculated based on user defined variables values (Penalty and Reserved capacity) so it must be done on frontend.
My question is what am I doing wrong, that calculation for Penalty does not work with synthetic dimension (expression as itself should be correct, based on that in other objects it works).
Maybe it is some stupis typo, but I am not able to get it work.
Your help is very appreciated.
For details see atached app.
Hi all,
I solved the problem. Using synthetic dimensioun would require to adjust data model because of field ConsumptionPeak (which contains also null values).
To create bar chart with current data model it requires to use dummy dimension and three measures. The result is as required.
Could you share the expression/how your calculating the dimension ? currently I don't have access for Qliksense ...if you share the expression we could help
Hi,
dimesion:
ValueList('Energy cost','Reserved capacity cost','Penalty')
measure:
If(ValueList('Energy cost','Reserved capacity cost','Penalty')='Energy cost',Sum(EnergyConsumption)*$(vCost),
If(ValueList('Energy cost','Reserved capacity cost','Penalty')='Penalty',Sum(If((aggr(ConsumptionPeak,[Year - Month])/0.25)>(vMonthCapacity+vYearCapacity),(aggr(ConsumptionPeak,[Year - Month])/0.25)-(vMonthCapacity+vYearCapacity),0))*vPenalty,
If(ValueList('Energy cost','Reserved capacity cost','Penalty')='Reserved capacity cost',$(vMonthCapacity)*$(PriceOfMonthCapacity)+$(vYearCapacity)*$(vPriceOfYearCapacity))))
avinashelite any inputs?
Is the other place where the expression works inside a chart or table with dimensions? Perhaps you have a field value aggregate that is defined in this context, but does not work in a global context.
Test the expression in a text box. If it works there, it should work in the ValueList expression.
Its hard to debug the expression when it contains embedded variables.
Hi, thank you for your reply.
Yes it should work but it does not. I works in both text field and KPI object. It shows something different than 0 if I use this expression in combination with some dimension.
Only where it does not work and I realy want it to is in this chart. It seems to be defined in global context.
Even if I change variables to numbers it is not getting better. (btw. variables are just numbers)
Any other ideas
>>It shows something different than 0 if I use this expression in combination with some dimension.
Do you mean 'some selection'? Does the chart version not behave in the same way? As you have observed, the ValueList() dimension does not create a local context like a field dimension, so the expression is evaluated in the same context as the KPI object. I do not see why they would be different.
Hi all,
I solved the problem. Using synthetic dimensioun would require to adjust data model because of field ConsumptionPeak (which contains also null values).
To create bar chart with current data model it requires to use dummy dimension and three measures. The result is as required.