Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I need to have a calculation condition based on a variable on a chart.
e.g. Value < $(vLimit)
vLimit is a variable that has a value. But the chart doesn't seem to take care of this condition. Can you please help?
Thanks,
Ram
Try setting this as your expression:
Sum({<Value={"<$(vLimit)"}>} Value)
This should sum together all rows where Value < vLimit. The total may of course be greater than vLimit as the comparison is done on a row level. Is this what you wanted?
Hope this helps,
Jason
Do you mean you don't want the chart to calculate at all or do you mean an individual expression?
Hi Jason,
I have a simple bar chat with 1 dimension and 1 fact(expression).The expression is sum(Value).
But I want the chart to take into consideration only those records that satisfy this condition
value < $(vLimit)
vLimit is a variable associated with an input box.
if i have rows like
dim1 Value
CON 1000
FX 2000
GA 2500
if vLimit is 1500, I want to show only CON in the chart.
Thanks
Ram
Try setting this as your expression:
Sum({<Value={"<$(vLimit)"}>} Value)
This should sum together all rows where Value < vLimit. The total may of course be greater than vLimit as the comparison is done on a row level. Is this what you wanted?
Hope this helps,
Jason
Thanks Jason. That answers my question and it is working fine.
Just want to make sure what is the utility of this Calculation condition then?
There may be circumstances where you do not want a chart to calculate at all. for example, it might be possible to return millions and millions of rows which may endanger your production servers at affect all users. You may want to tell the chart to only calculate if it is going to return a safe number of rows or perform the calculations over a safe size dataset.