Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum of monthend data

Hi all,

I need tp perform calculation for four quantity fields with the monthend function

i have tried sum(monthend(field1+filed2+field3)) but it hasnt worked

where field1 has a logic as follows

ReceiveDate <= monthend & GR_Date = “ ” or > monthend

can i know the perfect expression for this

8 Replies
er_mohit
Master II
Master II

try like this way

sum(Field1)+ sum(Field2)+sum(Field3)

here in Field1 write your condition including in sum() function and also write measure which you want

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Something like this:

Sum({<ReceiveDate = {"<=$(=MonthEnd(Today()))"}, GR_Date = {">$(=MonthEnd(Today()))", ' '}>} RangeSum(field1, field2, field3))

HTH

Jonathan

BTW be careful when adding. If any of the field1 - field3 is null, then that record will not add in the amounts for the other fields. RangeSum fixes that.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks for the reply but my condition is to get it for the monthend data but the expression that you provided gives the sum of all fields

Not applicable
Author

Hi

I have a doubt in this expression that the rangesum(fields) will give me the total sum right but i need it only for the last day of each month i.e by using monthend function

jonathandienst
Partner - Champion III
Partner - Champion III

You mean the expression should only be calculated for the last day of the month?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Usually I add a flag  =1 for end of month and I multiply by the flag.

Not applicable
Author

yeah that perfect everything that i calculate should be based on the last day of the month

Not applicable
Author

you can see the above straight table that displays some billions of data but the actual data should be lessthan 50millions and there is a problem in the average expression for the first field i got a value as 6.0 and the avg function doesnt work at all