# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

New Contributor II

## Aging with only business days

Hi all , i created below calculated dimension for aging   ,i do not want the weekends to get calculated in aging i want only the bushiness days to be calculated as aging .can anyone please help.

=if(Interval(today() - CreatedDateText,'DD') >=0 and Interval(today() - CreatedDateText,'DD') <= 5, '1-5Days',

if(Interval(today() - CreatedDateText,'DD') >=5 and Interval(today() - CreatedDateText,'DD') <=10, '5-10Days',

if(Interval(today() - CreatedDateText,'DD') >=10 and Interval(today() - CreatedDateText,'DD') <= 15, '10-15Days',

if(Interval(today() - CreatedDateText,'DD') >=15 and Interval(today() - CreatedDateText,'DD')<= 20,'15-20Days',

if(Interval(today() - CreatedDateText,'DD') >=20 and Interval(today() - CreatedDateText,'DD')<= 25,'20-25Days',

if(Interval(today() - CreatedDateText,'DD') >=25 and Interval(today() - CreatedDateText,'DD')<= 30,'25-30Days', 'Above 30 days'))))))

1 Solution

Accepted Solutions
MVP

## Re: Aging with only business days

May be like this:

=if(NetWorkDays(CreatedDateText, Today()) >=0 and NetWorkDays(CreatedDateText, Today()) <= 5, '1-5Days',

if(NetWorkDays(CreatedDateText, Today()) >=5 and NetWorkDays(CreatedDateText, Today()) <=10, '5-10Days',

if(NetWorkDays(CreatedDateText, Today()) >=10 and NetWorkDays(CreatedDateText, Today()) <= 15, '10-15Days',

if(NetWorkDays(CreatedDateText, Today()) >=15 and NetWorkDays(CreatedDateText, Today()) <= 20,'15-20Days',

if(NetWorkDays(CreatedDateText, Today()) >=20 and NetWorkDays(CreatedDateText, Today()) <= 25,'20-25Days',

if(NetWorkDays(CreatedDateText, Today()) >=25 and NetWorkDays(CreatedDateText, Today()) <= 30,'25-30Days', 'Above 30 days'))))))

4 Replies
MVP

## Re: Aging with only business days

May be like this:

=if(NetWorkDays(CreatedDateText, Today()) >=0 and NetWorkDays(CreatedDateText, Today()) <= 5, '1-5Days',

if(NetWorkDays(CreatedDateText, Today()) >=5 and NetWorkDays(CreatedDateText, Today()) <=10, '5-10Days',

if(NetWorkDays(CreatedDateText, Today()) >=10 and NetWorkDays(CreatedDateText, Today()) <= 15, '10-15Days',

if(NetWorkDays(CreatedDateText, Today()) >=15 and NetWorkDays(CreatedDateText, Today()) <= 20,'15-20Days',

if(NetWorkDays(CreatedDateText, Today()) >=20 and NetWorkDays(CreatedDateText, Today()) <= 25,'20-25Days',

if(NetWorkDays(CreatedDateText, Today()) >=25 and NetWorkDays(CreatedDateText, Today()) <= 30,'25-30Days', 'Above 30 days'))))))

Valued Contributor

## Re: Aging with only business days

Add one more If condition at the top

If ( match( weekday(CreatedDateText) ,'1','2','3','4','5' )   ,

or you can filter out only Monday-Friday in the backend and use the same If condition

New Contributor II

## Re: Aging with only business days

perfect buddy u r the troubleshooter

New Contributor II

## Re: Aging with only business days

you mean like this ?

=If (match(weekday(CreatedDateText) ,'1','2','3','4','5')  ,if(NetWorkDays(CreatedDateText, Today()) >=0 and NetWorkDays(CreatedDateText, Today()) <= 5, '1-5Days',

if(NetWorkDays(CreatedDateText, Today()) >=5 and NetWorkDays(CreatedDateText, Today()) <=10, '5-10Days',

if(NetWorkDays(CreatedDateText, Today()) >=10 and NetWorkDays(CreatedDateText, Today()) <= 15, '10-15Days',

if(NetWorkDays(CreatedDateText, Today()) >=15 and NetWorkDays(CreatedDateText, Today()) <= 20,'15-20Days',

if(NetWorkDays(CreatedDateText, Today()) >=20 and NetWorkDays(CreatedDateText, Today()) <= 25,'20-25Days',

if(NetWorkDays(CreatedDateText, Today()) >=25 and NetWorkDays(CreatedDateText, Today()) <= 30,'25-30Days', 'Above 30 days')))))))

this is not working