Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Specialist III
Specialist III

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

try

Channa
Highlighted

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