Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Sales

Hi All ,

I want to know how do we get the Sum(sales) only for field department ?

1 Solution

Accepted Solutions
Kushal_Chawda

try this

sum({<Department={"=sum(Sales)>0"}>}Sales)

View solution in original post

9 Replies
tamilarasu
Champion
Champion

Hi John,

Could you elaborate the requirement bit more..!!

MK_QSL
MVP
MVP

It would be same

=SUM(Sales)

gautik92
Specialist III
Specialist III

same

Sum(sales)

if yu want for specific department

then it would be

sum({<Department={'DepartmentName'}>}Sales)

smilingjohn
Specialist
Specialist
Author

I want to display the sales value only for a field by name department ,

smilingjohn
Specialist
Specialist
Author

When i say Department it is Field name ,

So according to your expression  it should display me the sales for the field Department right ?

sum({<Department={'DepartmentName'}>}Sales)


Kushal_Chawda

try this

sum({<Department={"=sum(Sales)>0"}>}Sales)

avinashelite

yes , you should have the Department as  Dimension  and then in expression you can try like

sum(sales) : to get the sales for all the department

sum({<Department={'A'}>}sales): to get the sales for only  department A

like this you can change the expression accordingly

Mark_Little
Luminary
Luminary

Hi,

As mentioned by other the standard set analysis should get the answer you want.

I.e. SUM({<Department={1}>}Sales)

But I guess it really depends how you data is laid out, I think we are all assuming it is like below.

DepartmentSales
1100
2200
1100
2200
1100
2200

and you are wanting the sales for say department 1? I.e. 300 in the above example.

Then the set analysis of SUM({<Department={1}>}Sales) will return the required value.

If this is not correct, could you please supply an example of your data?

Mark

MK_QSL
MVP
MVP

Good that you got the answer but actually your question itself was not complete...

Can you check below two expressions and let me know if you are getting any different result !

=SUM(Sales)

and

=SUM({<Department = {"=SUM(Sales) > 0"}>}Sales)