Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
We have created a Gauge chart which shows the data of the compnay correclty. We are also able to mark the segment properly.
However, we get stuck, when we try to give variable (changing) values to MAX option in gauge chart.
Our requirement is to make the value of MAX change when the user click on a specific product. As the target for each product will be different and we want to make the max value change per very product in a single gauge chart.
We used the "if" condition but it failed.
Need your assistance.
Regards,
Hitesh
Hi Hitesh,
Where are the values coming from for the Max of each product? Are they hard coded or derived from the data?
If they are hard coded something like this will work:
=if(Only(Product) = 'Ham', 2000, if(Only(Product) = 'Cheese', 3000, 2500))
You can nest the if statement as many times as you need. The final number is what is used if more than one product is selected or possible.
If the Max is derived from the data then you could us an aggregation to get there:
=Max(ProductMax)
or
=Avg(ProductMax)
If the gauge only makes sense when a single Product is selected then you can use the Calculation Condition or the Show Condition to hide the object or show an error message.
Generally, gauges are more hard to comprehend quickly if the max bound is moving about - but sometimes it is a requirement.
Hope that helps,
Steve
Please attach sample file..
Hi Hitesh,
Let use this sample expression for your variable:
=If(IsNull(GetFieldSelections(ProductField)),Sum(Amount),Max(Value))
Regards,
Sokkorn
Hi Fellows,
Please find the sample file here.
Regards,
Hitesh
Hi Hitesh,
Where are the values coming from for the Max of each product? Are they hard coded or derived from the data?
If they are hard coded something like this will work:
=if(Only(Product) = 'Ham', 2000, if(Only(Product) = 'Cheese', 3000, 2500))
You can nest the if statement as many times as you need. The final number is what is used if more than one product is selected or possible.
If the Max is derived from the data then you could us an aggregation to get there:
=Max(ProductMax)
or
=Avg(ProductMax)
If the gauge only makes sense when a single Product is selected then you can use the Calculation Condition or the Show Condition to hide the object or show an error message.
Generally, gauges are more hard to comprehend quickly if the max bound is moving about - but sometimes it is a requirement.
Hope that helps,
Steve
Hi Steve,
BULLS EYE
The if function worked in our max expression.
Thanks a lot guys for your help.
Hi Guys,
We have found solutions as suggested by Steve, we are using If(Only .. condition.
However, now when I view the entire company data in the gauge chart, it is throwing error of Bad min max value.
The If funciton is working fine when I select individual Product category, but when I make a complete selection og Product category or when I do not select any values in the Product category, we are getting the error of "Bad min max value in Gauge"
Hi there,
Do you have the final number in the IF statement, stating which value to use if there are multiple Product Categories selected?
=if(Only(Product) = 'Ham', 2000, if(Only(Product) = 'Cheese', 3000, 2500))
Steve
Yes Steve, got the issue resolved. Thanks for yout kind help.
Regards,
Hitesh