Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

QV formula

Hi guys,

Could you explain to me this formula :

if( match( date( Today(), 'M/D/YYYY'),  date( [ROW_LASTMANT_DTTM] , 'M/D/YYYY') )  , 0 ,(NetWorkDays([ROW_ADDED_DTTM],   Today()-1, $(vHol))) ) as  "AGE_INSTANCE",

with vHol =

'','','','1/1/2013 12:00:00 AM','1/1/2014 12:00:00 AM','1/1/2015 12:00:00 AM','1/13/2014 12:00:00 AM','1/14/2013 12:00:00 AM','1/14/2014 12:00:00 AM','1/14/2015 12:00:00 AM','10/15/2013 12:00:00 AM','10/15/2014 12:00:00 AM','10/15/2015 12:00:00 AM','3/20/2013 12:00:00 AM','3/20/2014 12:00:00 AM','3/20/2015 12:00:00 AM','4/9/2013 12:00:00 AM','4/9/2014 12:00:00 AM','4/9/2015 12:00:00 AM','5/1/2013 12:00:00 AM','5/1/2014 12:00:00 AM','5/1/2015 12:00:00 AM','7/25/2013 12:00:00 AM','7/25/2014 12:00:00 AM','7/26/2013 12:00:00 AM','8/13/2013 12:00:00 AM','8/13/2014 12:00:00 AM','8/13/2015 12:00:00 AM','8/8/2013 12:00:00 AM','8/9/2013 12:00:00 AM'


Thanks in advance

1 Solution

Accepted Solutions
PrashantSangle

Hi,

which part you are not getting??

it is simple if else

if today= row_lastmatnt_dttm

then 0

else calculate networkdays()

NetworkDays()

The networkdays function returns the number of working days (Monday-Friday) between and including start_date andend_date taking into account any optionally listed holiday.

Syntax

networkdays (start_date, end_date [, holiday])



Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

2 Replies
swuehl
MVP
MVP

This statement calculates a new field AGE_INSTANCE.

If the value of field [ROW_LASTMANT_DTTM] is euqal to today's date, then set a value of zero in the record for the new field, else calculate the networking days (Mon to Fri excluding the listed vHol dates) in the range from [ROW_LASTMANT_DTTM] to yesterday.

Have a look at Networkdays() and Match() function in the HELP for more details.

PrashantSangle

Hi,

which part you are not getting??

it is simple if else

if today= row_lastmatnt_dttm

then 0

else calculate networkdays()

NetworkDays()

The networkdays function returns the number of working days (Monday-Friday) between and including start_date andend_date taking into account any optionally listed holiday.

Syntax

networkdays (start_date, end_date [, holiday])



Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂