Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
stephenedberkg
Creator III
Creator III

set analysis in bar chart

i want to show sales >= target

i have some of product each product have the sales and target.my dimension is product

i want to show in bar chart which product sales values is greater or equal to the target values.

i dont want to show the sales values which are below the target values

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try like:

Dimension: Product

Exp: Sum({<Product={"=Sum(Sales)>=Sum(Target)"}>}Sales)

View solution in original post

6 Replies
tresB
Champion III
Champion III

Try like:

Dimension: Product

Exp: Sum({<Product={"=Sum(Sales)>=Sum(Target)"}>}Sales)

maleksafa
Specialist
Specialist

if(sum(sales) >= sum(target),sum(sales))

this will only show the sales by product that are greater than the target

Anonymous
Not applicable

I guess you can use Calculated Dimension like:

if((aggr(sum(sales), Product)>=(aggr(sum(Targets), Product), ProductDimension) as Product_Dimension

and expression as per your requirement.

Else you can create a flag at Script/Backend if all the fields are in one table.

Hope this will help!!

tamilarasu
Champion
Champion

Hi Tresesco,


Just a question. Each product have some target, so why you used sum(Target) in the expression.!!


It should be like Sum({<Product={"=Sum(Sales)>=Target"}>}Sales). Right?


Correct me If I am wrong.

tresB
Champion III
Champion III

There could be multiple sub lines to that. What if I wish to have aggregated result irrespective of say a dimension Region? Otherwise, logically you are not wrong. But it's safer to use an aggregation function, after all that doesn't harm you here.

tamilarasu
Champion
Champion

Thanks for the explanation.