Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum when empty

Hi all,

This part of my expression does not want to work. When Ontvangst_Ontvangstdatum  is empty it should sum Inkoopfactuurregel_Aantal, alternatives are welcome too.

Thanks!

Sum(
{<
 
Ontvangst_Ontvangstdatum -= {'*'}
>}
Inkoopfactuurregel_Aantal
))

1 Solution

Accepted Solutions
vivientexier
Partner - Creator II
Partner - Creator II

Hello,

In your script, add a flag to your field Ontvangst_Ontvangstdatum.


If(Len(Ontvangst_Ontvangstdatum)=0, 1) as Ontvangst_Ontvangstdatum_flag

then, all you neeed to do is :

Sum(
{<
  Ontvangst_Ontvangstdatum_flag
= {1
}
>}
Inkoopfactuurregel_Aantal
)

View solution in original post

4 Replies
vivientexier
Partner - Creator II
Partner - Creator II

Hello,

In your script, add a flag to your field Ontvangst_Ontvangstdatum.


If(Len(Ontvangst_Ontvangstdatum)=0, 1) as Ontvangst_Ontvangstdatum_flag

then, all you neeed to do is :

Sum(
{<
  Ontvangst_Ontvangstdatum_flag
= {1
}
>}
Inkoopfactuurregel_Aantal
)

Not applicable
Author

Thank you for this most simple answer,

will use the method in general!

THANKS!

lironbaram
Partner - Master III
Partner - Master III

may try to use

Sum(
if isnull(
Ontvangst_Ontvangstdatum),
Inkoopfactuurregel_Aantal
))

Not applicable
Author

Thanks Liron,

but that was my expression before my solution. The Isnull Function does not always work for me, esspeccially when you start summing up the expressions is rarely gives the right answer.

Thanks, Im working witht the option Vivien gave, this seems to work fine.

regards,