Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List box with expression

Dear Community,

I want to display the list of country where the condition is media investment and revenue is greater than 0.

I tried with 2 expressions but not working.

Appreciate if you could help.

Expressions

1. =if([Media Investment] > 0 and Revenue > 0, Countrytarget)

2. = if([Media Investment] > 0, if([Revenue] > 0 , Countrytarget))

Thanks and best regards,

Chanel

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This should work:

=Aggr(if([Media Investment] > 0 and Revenue > 0, Countrytarget), Countrytarget)


HTH

Jonathan


Edit: assumes that there is countrytarget, revenue and media investment have a 1:1:1 relationship. Otherwise , use sum() or ave() as per HC's post

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

5 Replies
Not applicable
Author

Hi

PFA Try this if it is wrong please try the below expression

=if([Media Investment] > 0 or Revenue > 0, Countrytarget)


oterwise please attach your sample app

hic
Former Employee
Former Employee

Your expressions will not work since you use unaggregated field references. Add aggregation functions, e.g.

=if(Sum([Media Investment]) > 0 and Sum(Revenue) > 0, Sum(Countrytarget))

See more on http://community.qlik.com/blogs/qlikviewdesignblog/2013/08/06/it-s-all-aggregations

HIC

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This should work:

=Aggr(if([Media Investment] > 0 and Revenue > 0, Countrytarget), Countrytarget)


HTH

Jonathan


Edit: assumes that there is countrytarget, revenue and media investment have a 1:1:1 relationship. Otherwise , use sum() or ave() as per HC's post

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi Henric,

But it is working if i use :

=if( (Revenue) > 0, Countrytarget)

Thanks and best regards,
Chanel

Not applicable
Author

Thanks Jonathan and Henric Cronström!

It is working with combination of HC's post.

=Aggr(if(sum([Media Investment]) > 0 and sum(Revenue > 0), Countrytarget), Countrytarget)

Thanks and best regards,

Chanel