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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tdiwanji
Contributor
Contributor

Getting an error in expression in if condition

Hi,

 

I am trying to find out following.

if End date is not null, then end date - start date+1 else today-start date. While doing so, i am getting error in expression error. Would anyone help me to resolve ?

 

=if((not isnull[End_date],
[End_date]-[Start_date]+1), today()-[Start_date])

2 Replies
Channa
Specialist III
Specialist III

=if(not isnull([End_date]),([End_date]-date([Start_date],1)), today()-[Start_date])

try

Channa
jonathandienst
Partner - Champion III
Partner - Champion III

You can simplify the expression like this:

=Alt([End_date] + 1, Today()) - [Start_date]
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein