Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select/Filter records in chart based on expression value

Hello,

I'm wondering if it is possible to select records shown in a chart based on the value of an expression within that chart. In other words, I would like to have a user enter (in an input field I assume) a value then have the chart display only those records that the expression within the chart matches that value. For example, say I have a simple Sales, Cost, GM% chart like this:

Item Sales Cost GM%

12345 100 80 20%

55555 80 75 6.25%

98765 200 150 25%

GM% is an expression ([Sales] - [Cost]) / [Sales]). It can't be calculated in the script because Sales and Cost are sums of many records.

Say my input field has the value of 20. I would like to display only those records that GM% matches (in this case just the first record). Is there a way to accomplish something like this?

Thanks.

12 Replies
Not applicable
Author

If you know the dimensions you are using to analyze the expression (for example, the dimensions of the chart), then you can create a synthetic dimension using the aggr() function to test the expression, and then use the "Suppress null values" option to remove results that don't meet the conditions.

To use your example:

  1. Add a synthetic dimension: if( (aggr((sum(Sales) - sum(Cost)) / sum(sales), Item)) > $(vThreshold), ' ')
  2. Check the "Suppress null values" option
  3. Create a vThreshold variable to control what is displayed


This will keep your Totals bar intact.

See my example for more details.

Not applicable
Author

Hi,

I've an expression like: sum(distinct Sales)/1000 in a st. table having 8

dimensions...now the expr can range from 0 to any big value.i want to create an

input box where the user can enter a number & the expression shud show only the

values  wich are greater than the value entered by the user.

Plz  help

Not applicable
Author

Hi,

Cud u plz explain how does the searchable feature allows entering a range of values..i can enter only fixed values.

Regards