Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Use a Column in SUM Expression

HI, I am trying to use one column as an filter condition for my sum Expression, like this: =SUM({} EngedMem_Rnk) Where Date is a column in my data set, but it’s not working. If I remove Date condition from my expression, its working fine. =SUM({} EngedMem_Rnk) Any idea, what I am missing I need to Include Date Column in my sum Expression. Thanks Sandeep

5 Replies
v_iyyappan
Specialist
Specialist

Hi,

Use like this for max date filter using set analysis:

=Sum({<DateField={"$=(max(DateField))"}>}EngedMem_Rnk)

Regards,

Not applicable
Author

Hi Sandeep,

What date condition you are writing? Please elaborate your problem or provide qvw.

Regards,

Anosh

Not applicable
Author

Hey Anosh, I am trying to calculate my SUM on the basic of three conditions, like bellow =SUM({} EngedMem_Rnk) Where in first condition DateType = {3}, 3 is an value I am putting. first condition ENG_DATE = {Date}, Date is a Column in my Data Set, from which I need to calculate.

Not applicable
Author

It's not working, I have a question, why I should use Max, as I said Date is a column, value of date column for each row should get considered while calculation.

Not applicable
Author

Hi Sandeep,

Set analysis doesn't calculate RHS clause row by row. for eg if expression is: sum({<Year={abc}>} amount) where abc is caculated only once and used in all records, thats why it should be Max,Min or something else to return only one value. If you want to use Date in your calcuation then put Date colume in dimension and the expression will automatically start taking it into consideration.

Hope this help,

Anosh