Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Expression logic

HI All,

How can i right the expression when i need to show sum of sale when LogedDate is null and Recieved Date is null.

thanks

1 Solution

Accepted Solutions
shiveshsingh
Master
Master

Try this

if(isnull(LogedDate ) and isnull([Recieved Date]),Sum(Sales))

View solution in original post

3 Replies
shiveshsingh
Master
Master

Try this

if(isnull(LogedDate ) and isnull([Recieved Date]),Sum(Sales))

MK_QSL
MVP
MVP

You can create back end flags for null dates.

If(IsNull(LoggedDate) or Len(Trim(LoggedDate))=0, 1) as Flag_LoggedDate,

If(IsNull(ReceivedDate) or Len(Trim(ReceivedDate))=0, 1) as Flag_ReceivedDate

now use

=SUM({<Flag_LoggedDate = {1}, Flag_ReceivedDate = {1}>}Sales)

Or without creating flags...

=SUM(IF(IsNull(LoggedDate) and IsNull(ReceivedDate),Sales))

MK_QSL
MVP
MVP

or

=SUM(Sales)-SUM({<LoggedDate = {"*"}>+<ReceivedDate = {"*"}>}Sales)

or

=SUM({1}Sales)-SUM({1<LoggedDate = {"*"}>+1<ReceivedDate = {"*"}>}Sales)