How would I create a guage based on Conditions

Posted by mysteryminds on 06-Mar-2015 19:20

I'm showing a guage with total number of records this way "return rbv_api.getCount(62898098);"

But I would like to show the count based on only some specific location which is based on LOCATION ID 

That means if my total records value based on "return rbv_api.getCount(62898098);"  = 100 Records and my Guage must show  based on locations  ( A + B + Y + Z + X) = 15

Kindly let me know, if I have to write a nested conditions or the SQL 

All Replies

Posted by mysteryminds on 07-Mar-2015 05:26

anyone to help in here please

Posted by Jean Richert on 07-Mar-2015 07:02

Hi mysterymins, I'm sure someone will get back to you on Monday...

Posted by cohezive on 08-Mar-2015 00:36

In one gauge?  I think that's more a chart (or a very custom gauge with multiple dials in different colors).

However, if it's a set of gauges, one for each location, then a Query should more than capable to provide that with a different Query for each gauge.

Or if you want one gauge for the sum of locations (compared to the total), also a Query.

A Query to give you totals by location just needs a Group By add-on to Select Count().  But that's where a Chart makes more sense.  It's designed to handle the type of display for multiple locations,

Posted by mysteryminds on 09-Mar-2015 08:22

well i would want to have it one guage where it shows in single information

This guage would show the value which is single value  - I would want a single sum of location

Posted by Ricardo Rafols on 09-Mar-2015 13:45

Hi mysteryminds,

The correct syntax for getCount is rbv_api.getCount(viewId, filterName, filterValue)

try to use something like this:

return Number(rbv_api.getCount('your viewer id', 'location', 'A')) +

Number(rbv_api.getCount('your viewer id', 'location', 'B')) +

Number(rbv_api.getCount('your viewer id', 'location', 'X')) +

Number(rbv_api.getCount('your viewer id', 'location', 'Y')) +

Number(rbv_api.getCount('your viewer id', 'location', 'Z'));

Or you can use

rbv_api.selectQuery("SELECT count(*)  FROM <your table> WHERE location IN ('A','B','C','X','Y','Z')", 1)

Posted by mysteryminds on 09-Mar-2015 13:46

thanks a ton Ricardo... works like charm ...

Posted by mysteryminds on 09-Mar-2015 19:17

Ricardo one simple question in here how do i link the view to show the same amount of data in drill down

Posted by Ricardo Rafols on 12-Mar-2015 07:12
Hi mysteryminds,
 
You need to clone the viewer used to show records in your gauge.
 
In the new viewer:

-      Check the option “Hide count of total records for this view”.

-      Change viewer to run formula instead of using the 5 available filter fields.

 
As “location” is a Related Field (in your case), you need to create a formula like this:
 
TL0.LOCATION_ID IN ('A','B','C','D','X', 'Y','Z')
 
Please let me know if it works for you.
 
Regards,
Ricardo
 
 
 
[collapse]
From: mysteryminds [mailto:bounce-ksunilallwesterncom@community.progress.com]
Sent: Monday, March 09, 2015 8:18 PM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] How would I create a guage based on Conditions
 
Reply by mysteryminds

Ricardo one simple question in here how do i link the view to show the same amount of data in drill down

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
Posted by mysteryminds on 12-Mar-2015 13:39

Thanks a ton Ricardo.... you are magician and it stunningly works..... just that the count is not working...

Posted by Ricardo Rafols on 13-Mar-2015 11:54
Hi mysteryminds,
 
I’m sorry, but the only way to make it happen is hiding the count of total records.
 
Regards,
Ricardo
 
 
[collapse]
From: mysteryminds [mailto:bounce-ksunilallwesterncom@community.progress.com]
Sent: Thursday, March 12, 2015 2:40 PM
To: TU.Rollbase@community.progress.com
Subject: RE: [Technical Users - Rollbase] How would I create a guage based on Conditions
 
Reply by mysteryminds

Thanks a ton Ricardo.... you are magician and it stunningly works..... just that the count is not working...

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
This thread is closed