# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
cancel
Showing results for
Did you mean:
Not applicable

## Expression Help

Dear Experts,

I used following expression in my application for a date calculation.

(IF(STATUS='ACTIVE', NUM(TODAY())-(DATE(DATE#(LON_DATE))),DATE(DATE#(SET_DATE))-DATE(DATE#(LON_DATE)))+1)

This expression counts the number of days from the 'LON_DATE' to the current date including 'LON_DATE'.

So now i need to remove(Exclude) the all "Saturdays and Sundays" comes after 'LON_DATE' from this calculation.

How i can do this with Qlick view.

Rgds,

Priyantha.

1 Solution

Accepted Solutions
MVP

Not sure what you chart dimensions are, but assuming you have Dim1 and Dim2.... you need this

Sum(Aggr(

If(Status = 'ACTIVE,

NetWorkDays(Date(Date#(LON_DATE)), Today()),

NetWorkDays(Date(Date#(LON_DATE)), Date(Date#(SET_DATE)))) + 1

, Dim1, Dim2))

5 Replies
MVP

May be this:

If(Status = 'ACTIVE,

NetWorkDays(Date(Date#(LON_DATE)), Today()),

NetWorkDays(Date(Date#(LON_DATE)), Date(Date#(SET_DATE)))) + 1

Creator

Hi,

By using Networkdays() function we can exclude all "Saturdays and Sundays".

Not applicable
Author

Dear Sunny,

I have achieved the expected output with your suggestion. But the expression does not support with the subtotals.

As i think it required a small modification.

Can you help to find the relevant modification?

Thnx & Rgds,

Plriyantha.

MVP

Not sure what you chart dimensions are, but assuming you have Dim1 and Dim2.... you need this

Sum(Aggr(

If(Status = 'ACTIVE,

NetWorkDays(Date(Date#(LON_DATE)), Today()),

NetWorkDays(Date(Date#(LON_DATE)), Date(Date#(SET_DATE)))) + 1

, Dim1, Dim2))

Not applicable
Author

Thanx Dear....