Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi everyone
I flagged some values based on this formula so i'm trying to create a filter so that user can filter the flag , so i'm not sure of how do i create a filter from calculated value in frontend.
formula is : if(sum( [Unit Retail Price]-[PO Unit Cost])/sum( [Unit Retail Price]) <0.35 , ARGB(125,235, 51, 30),if(sum( [Unit Retail Price]-[PO Unit Cost])/sum( [Unit Retail Price]) >.65,argb(125,235, 51, 30)))
i just want to create a filter in front end when user click on it it show values filtered by formula above
i've attached pic of flags below
thank you in advance.
Because you are using an aggregation -- "Sum" --, you need to specify what field to aggregate (group) by. In a chart, this is done by adding dimensions to the chart. In a filter, you must specify the dimension explicitly using Aggr().
For example, if we want a filter that puts Customers in two buckets, those with more than 500k in sales and those with less.
Aggr(if(Sum(Sales) > 500000, 'Over', 'Under'), Customer)
In your example it looks like you are setting the color when the calculation result is < 0.35 or > 0.65. Let call the colored "Yes" and the others "No". I'll assume your dimension is "Product".
Aggr(
if(sum( [Unit Retail Price]-[PO Unit Cost])/sum( [Unit Retail Price]) <0.35
or if(sum( [Unit Retail Price]-[PO Unit Cost])/sum( [Unit Retail Price]) >0.65
, 'Yes', 'No')
, Product)
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Hi,
You should be able to put your formula into a filter. Here is an example:
I created a simple table with my "Audit ID". Within the table, I have a color expression.
I've then created a filter which mirrors my color expression, substituting the colors for a name of the filter option.
You are then able to use that filter to essentially filter by color.
Because you are using an aggregation -- "Sum" --, you need to specify what field to aggregate (group) by. In a chart, this is done by adding dimensions to the chart. In a filter, you must specify the dimension explicitly using Aggr().
For example, if we want a filter that puts Customers in two buckets, those with more than 500k in sales and those with less.
Aggr(if(Sum(Sales) > 500000, 'Over', 'Under'), Customer)
In your example it looks like you are setting the color when the calculation result is < 0.35 or > 0.65. Let call the colored "Yes" and the others "No". I'll assume your dimension is "Product".
Aggr(
if(sum( [Unit Retail Price]-[PO Unit Cost])/sum( [Unit Retail Price]) <0.35
or if(sum( [Unit Retail Price]-[PO Unit Cost])/sum( [Unit Retail Price]) >0.65
, 'Yes', 'No')
, Product)
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com