Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Diff two dates

Hello Guys,

I need your help

I have to count the difference between two dates without counting the sundays

Any idea please ?

Thanks

5 Replies
Highlighted

May be look here:

Networkdays with saturday

Highlighted
Creator II
Creator II

Highlighted
Creator III
Creator III

i see that the solution is to create a function, how to do that please?

Thanks

Highlighted

Function is give by Gysbert in that link

Function GetWorkDays(StartDate, EndDate)

    dCount = 0

    For dt = StartDate To EndDate

        If WeekDay(dt) <> 1 Then

            dCount = dCount + 1

        End If

    Next

    GetWorkDays = dCount

End Function

Highlighted
Creator II
Creator II

Use SET on top, something like this

below example is Not your case:

SET MonthDiff = Num(((year($2) * 12) + month($2)) - (((year($1) * 12) + month($1))) + 1);