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 A Value Based On Null In Another Column

Within a chart I need to sum the hours taken to do a job, DmBAA.REGHOURS, when a certain column in the data , DmBAA.EQUIPNUM, has a null value. I've tried if (IsNull(DmBAA.EQUIPNUM), Sum(DmBAA.REGHOURS)) but it sums all the values rather than just the null ones. Can any one help?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Not sure, if this is correct, because I don't know your dimensions, data model etc, but I would try:

=sum(if(isNull(DmBAA.EQUIPNUM)=-1,DmBAA.REGHOURS))

i.e. putting the if() inside the sum to limit the rows to sum.

Regards,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Not sure, if this is correct, because I don't know your dimensions, data model etc, but I would try:

=sum(if(isNull(DmBAA.EQUIPNUM)=-1,DmBAA.REGHOURS))

i.e. putting the if() inside the sum to limit the rows to sum.

Regards,

Stefan

Not applicable
Author

Thanks for the help it worked perfectly