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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
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.

Labels (1)
3 Replies
BalaBhaskar_Qlik
Master
Master

sunny_talwar
MVP
MVP

May be this

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

BalaBhaskar_Qlik
Master
Master

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))),