Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
CrysiiD_BI
Contributor II
Contributor II

Qlik Change count to Sum

How can I turn this set analysis to sum instead of count?

Every way I try it does not return the right amount. 

I am trying to sum the IsOpen but I need it to sum for only the Help Desk Support and for the year 2022. 

Count({$<IsOpen, Teams = {'Help Desk Support'}, YearBL = {'$(vCurrentYear)'}>} distinct RequestID)

Thanks for your help. 

 

1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

If my understanding is correct, then you are trying to sum all the values of the field IsOpen, where the Teams field equals to 'Help Desk Support' and the YearBL field equals to 2022, which is the current year. 

 

If you are getting unexpected results with your expressions, one recommendation is to always test the expressions in a new app with a new simple dataset. Preferably less records, where you can see clearly what exactly is your expected output and as soon as you make the expression work there, you can transfer it to your original application.

 

On my side, I have followed the steps below:

 

1. I have used a simple dataset with few values:

SCREENSHOT

 

2. The green values are the one that interests us and based on the requirements that you have provided, we need to sum the values 30 and 40, since those are the only values where Teams = Help Desk Support and at the same time YearBl = 2022. Therefore, the expected output is 30+40=70.

 

3. Now I have loaded the data in Qlik Sense:

SCREENSHOT

 

4. And I have created an KPI chart with expression: =Sum( {<Teams={'Help Desk Support'}, YearBL={'$(vCurrentYear)'}>} IsOpen )

SCRENSHOT

 

As you can see, the KPI is 70, which means that the expression is working as expected.

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

1 Reply
Andrei_Cusnir
Specialist
Specialist

Hello,

 

If my understanding is correct, then you are trying to sum all the values of the field IsOpen, where the Teams field equals to 'Help Desk Support' and the YearBL field equals to 2022, which is the current year. 

 

If you are getting unexpected results with your expressions, one recommendation is to always test the expressions in a new app with a new simple dataset. Preferably less records, where you can see clearly what exactly is your expected output and as soon as you make the expression work there, you can transfer it to your original application.

 

On my side, I have followed the steps below:

 

1. I have used a simple dataset with few values:

SCREENSHOT

 

2. The green values are the one that interests us and based on the requirements that you have provided, we need to sum the values 30 and 40, since those are the only values where Teams = Help Desk Support and at the same time YearBl = 2022. Therefore, the expected output is 30+40=70.

 

3. Now I have loaded the data in Qlik Sense:

SCREENSHOT

 

4. And I have created an KPI chart with expression: =Sum( {<Teams={'Help Desk Support'}, YearBL={'$(vCurrentYear)'}>} IsOpen )

SCRENSHOT

 

As you can see, the KPI is 70, which means that the expression is working as expected.

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂