Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression using both Input Box and set variables

I have a Pivot Table in which I have a field to calculate the number of working days using a NetWorkDays expression. Now my client asked me to make some modifications to that table so that she has the option to input the end day in the NetWorkDays function. I've added a variable called vCustomEndDate which I can modify in an Input Box. Now when it comes to the expression I'm trying to branch it via an If(something like If(vCustomEndDate is not null, NetWorkDays(start_date,vCustomEndDate,$Holidays),NetWorkDays(start_date,end_date,$Holidays))).
Now my question is:How can I validate whether vCustomEndDate is null or not? I've tried If(vCustomEndDate -= {"=Null()"},NetWorkDays(start_date,vCustomEndDate,$Holidays),NetWorkDays(start_date,end_date,$Holidays))), but I got some errors.

3 Replies
sunny_talwar

May be this

If(Len(Trim(vCustomEndDate)) > 0, NetWorkDays(start_date, vCustomEndDate, $Holidays), NetWorkDays(start_date, end_date, $Holidays)))

balabhaskarqlik

May be these:

If(IsNull($(vCustomEndDate)),

NetWorkDays(start_date,$(vCustomEndDate),$Holidays),

NetWorkDays(start_date,end_date,$Holidays))),

If(Len(Trim($(vCustomEndDate))) = 0 or $(vCustomEndDate) = ' ',

NetWorkDays(start_date,$(vCustomEndDate),$Holidays),

NetWorkDays(start_date,end_date,$Holidays))),