Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinM
Contributor III
Contributor III

Sum values of a column based on meeting 2 other criteria (Similar to Sumifs in excel)

Hi

I'm brand new to Qlik Sense so still finding my way around.

I am trying to create a Master Item that will calculate the sum of another measure based on meeting certain criteria. 

Example:

In the following Table I would like to sum the values in a value column based on an ID and where the Months are the same . It will then give the Expected Answer.

I managed to get one part right to sum the value based on ID

Sum(TOTAL <id> value)

but do not know how to add the criteria for Month?

 

MonthIDTypeValueExpected Answer
202001121030
20200114200
202001122030
20200114300
202002124060
20200214200
202002122060
202001221060
202001222060
202001223060
202001322050
202001323050
20200134300

 

Do not have programming back ground so would appreciate reason for each part of solution if that is not too much to ask

Thanks

Labels (1)
1 Solution

Accepted Solutions
JustinM
Contributor III
Contributor III
Author

Hi

Thank you for the assistance. I've found the way to fix my query:

Sum(TOTAL <id,Month>Value)

and it looks like the rest of my problem needs some sort of Set parameter solution, so once I figure out how to approach that I will resubmit a question.

Much appreciated

View solution in original post

5 Replies
morgankejerhag
Partner - Creator III
Partner - Creator III

Welcome to Qlik! Are the columns 1-4 in the data? Are you showing this in a table? Which dimensions do you use? If you make a table with Month and ID as dimensions and the measure sum(Value) you might get what you are looking for.

Morgan Kejerhag
Senior Business Intelligence Consultant
Drake Analytics
http://www.drakeanalytics.se

JustinM
Contributor III
Contributor III
Author

Hi Morgan

Thanks for the reply

Yes, columns 1-4 is in the data. I want to use the results of the above query as part of a measure tin a pivot table hat would distinct count the id, where the sum was larger than 0?

Saravanan_Desingh

Are you sure202001,1,4 is 0? It should be 50(20+30) right?

morgankejerhag
Partner - Creator III
Partner - Creator III

Which dimensions do you have in the pivot?

Morgan Kejerhag
Senior Business Intelligence Consultant
Drake Analytics
http://www.drakeanalytics.se

JustinM
Contributor III
Contributor III
Author

Hi

Thank you for the assistance. I've found the way to fix my query:

Sum(TOTAL <id,Month>Value)

and it looks like the rest of my problem needs some sort of Set parameter solution, so once I figure out how to approach that I will resubmit a question.

Much appreciated