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

Sum If Logic

Hi,

Can anyone please help me understand what is wrong with this current logic? 

sum(if([Date_In]={">=$(=MonthStart (Today()-1))<=$(=MonthEnd (Today()-1))"} and len(trim(Category))<>0 ,Volume)

1 Reply
andoryuu
Creator III
Creator III

You don't need an if statement - it slows down your calculation so try to avoid it at all costs. This will give you the values that are in the month and then remove the records that have a blank or null Category value (you'll notice that I handled this by getting all category values thus excluding nulls and then also removing the empty string).  I've attached an example app.


=sum({<[Date_In]={">=$(=MonthStart (Today()-1))<=$(=MonthEnd (Today()-1))"}>*(<Category={"*"}>-<Category={''}>)} Volume)