Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
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
BI Consultant
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.
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
Hi
try like this
NetWorkDays(Min(ZSD_PIPELINE.ZZCFDT), Max(ZSD_PIPELINE.ZZRQDT))
Hi,
Try changing the fields like below
NetWorkDays(ZSD_PIPELINE.ZZRQDT, ZSD_PIPELINE.ZZCFDT)
Syntax:
networkdays (start:date, end_date {, holiday})
Regards,
Jagan.