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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Problem

Hi,

I have a question. I have a data like this

Place                    Name               Cost

A                             Aa                    1000

B                              Bb                    2000

-                              Cc                     3000

I want to show sum(cost) and exclude the data that doesn't has place, I used Name as dimension in the straight chart. I've try to use this expression :

=Sum({<Place=-{''}>}Cost)

It works perfectly, but i have a list box that contain Place Dimension. When i choose one place, lets say A the total value is 3000 (A+B) i want to make the total only A (1000) and only A is choosed. anybody knows how ?

Really appreciate your help, thanks.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If the "-" represents a null, then this should work:

sum({<Place=P()>}Cost)

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

7 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If the "-" represents a null, then this should work:

sum({<Place=P()>}Cost)

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable
Author

Hi Rob,

Thanks for your answer, it works perfectly, but it returns red underline (error) in the expression. Do you know how to solve the error ?

Thanks

sunny_talwar

Its not an error, its just means that expression editor doesn't understand the syntax. If you still insist to have the red line removed, you can try this:

Sum({<Place = {'*?'}>}Cost)

Not applicable
Author

Hi,

Thanks Rob and Sunindia, you guys are good problem solver.

Thanks

sunny_talwar

No problem

Glad we were able to help.

Best,

Sunny

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Sunny, your solution will remove the syntax error, but I believe it creates the original problem. It will ignore any selections made in "Place".

This form will make the syntax checker happy and honor selections in Place.

=sum({<Place=P({$})>}Cost)

-Rob

sunny_talwar

Thanks for catching that Rob‌, I need to spend a little more time reading the requirement before responding to them

Best,

Sunny