Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Sum

Hi I am a beginner to Qlik Sense.

There is a data set where Sales/Account/Segment/Revenue.  I'm trying to make a sum of revenue from a specific Sales with specific Segment, eg. Sum({<[Sales]={"Name A"}>}{<[Segment]={"Segment A"}>}[Revenue]).  But then it shows the specific Segment, but doesn't filter specific Sales.  From the below example, the answer should be 100.

Sales         Account         Segment         Revenue

Name A     Account A     Segment A     100

Name B     Account B     Segment A     100

Name C     Account C     Segment B     50

Name A     Account D     Segment B     80

Name C     Account E     Segment A     120

But what I got is all from Segment A.  Not sure what I did wrong.  I'd appreciate your advice using Sum.  Also, would it make sense to use Aggr function as well?

Cheers!

5 Replies
Anonymous
Not applicable
Author

Hello Friend,

Your solution is almost good, try this:

=Sum({<[Sales]={"Name A"},[Segment]={"Segment A"}>}[Revenue])


Regards

Jacek.

Not applicable
Author

Hi Jacek, thanks for the reply.  I tried it but it did not give me the result I wanted.  

Do you think it's because I put Account as a dimension?  I'm trying to create a chart which shows daily(X-axis) revenue(Y-axis) spending trend by the specific Sales + specific Segment and by Accounts (bars).

Regards,

Sungwoo

ahaahaaha
Partner - Master
Partner - Master

Hi Sungwoo,

For example, create table chart. Dimensions [Segment], [Sales], expression Sum(Revenue). Farther, selections in the filters you can get different results (see attached file).


Regards,

Andrey

Not applicable
Author

Hi Andrey, thank you for your answer.

I have one additional question to your feedback.  Can we limit the filtering on Sheet 1 to its own only?  When I created filters, it was applied to all Sheets in an app.  I am curious if there's a way to control the filtering range.

Thanks,

Sungwoo

Anonymous
Not applicable
Author

Hello,

Could you upload a sample of your app?

Regards

Jacek.