Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing NetWorkDays in set analysis

Hi

I'm very new to Qlikview and I'm trying to show the difference in days between two field names that have dates behind them, but I want to show it in NetWorkDays and I would like to show this as set analysis and don't know how to show this in a formula.

The fields names are ZSD_PIPELINE.ZZCFDT and ZSD_PIPELINE.ZZRQDT  with the 2nd taken away from the 1st.

Thanks in advance.

6 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

You can use NetWorkDays() to calculate working days, it excludes Saturdays and Sundays and given Holidays list.

networkdays (start:date, end_date {, holiday})

Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.

Examples:

networkdays ('2007-02-19', '2007-03-01') returns 9 

networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26') returns 8 

Check this in Help file.

Regards,

Jagan.

magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi jagan mohan.

You can (should) try and do this calculation in your load script instead of at runtime.

It will render better performance, both CPU and RAM-wise.

This is usually good practise, it will usually not affect file size since those <int> networkdays might already exist in other fields in your datamodel. Thus not adding more data to themodel, instead only linking to existing values already present.

Kind regards

Magnus Åvitsland

BI Consultant

Framsteg Business Intelligence Corp.

Not applicable
Author


Hi Magnus

Sorry should have explained myself better I'm creating a weview for other users to see data from a predefined script taken from SAP and am unable to change it. So have to do any data manipulation within the tables I create.

I did this with the information Jagan posted NetWorkDays(ZSD_PIPELINE.ZZCFDT, ZSD_PIPELINE.ZZRQDT)

but only got back 0 values.

Thanks for your help.

Not applicable
Author

have you tried changing the fields around? networkdays works from start and counts to finish, rather than counting back from finish to start

end formula should be NetWorkDays(ZSD_PIPELINE.ZZRQDT,ZSD_PIPELINE.ZZCFDT) if I read your question correctly

avinashelite

Hi

try like this

NetWorkDays(Min(ZSD_PIPELINE.ZZCFDT), Max(ZSD_PIPELINE.ZZRQDT))

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try changing the fields like below

NetWorkDays(ZSD_PIPELINE.ZZRQDT, ZSD_PIPELINE.ZZCFDT)


Syntax:

networkdays (start:date, end_date {, holiday})

Regards,

Jagan.