Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I struggling to create a loop to translate a specific business rule.
I need to create a rule in Qlikview that loops trough the the dates that an employee called sick.
If the last sickness date of that employee is smaller than 28 days, then the duration of the last sickness day,
should be accumulated with the duration of the last sickness duration.
If the sickness between the previous sickness date is longer than 28 days, then the duration of the last sickness is being used.
I really hope the above is clear. My apologize for my English.
To clarify the above, please look excel file. and the QV file.
Please let me know if you have any questions or if the above is not clear.
Cheers.
Sam
Hi Sam,
As I checked your data, it contained duplicate rows.
I reapplied same script using "distinct" and it seems to give logical results.
You can check the attached app for the results and compare later when you reload (note that i'm reading your temp.qvw as binary in the beginning of the script).
Hello Sam,
You can find attached an app that hopefully answers your request.
Cheers !
Hi Jean-Pierre,
Sorry for the late response.
Thanks for your help! Unfortunately this works on 1 employee. When I apply your script to my table I get strange results.
Have a look at employeeID= 5240. This person called sick 10 times, often within the 28 days limitation. However looking at the field 'cumulativedurationstart' I don't get the disired results.
Thanks in advance!
Sam
Hi Sam,
As I checked your data, it contained duplicate rows.
I reapplied same script using "distinct" and it seems to give logical results.
You can check the attached app for the results and compare later when you reload (note that i'm reading your temp.qvw as binary in the beginning of the script).
Hi Jean-Pierre,
Thanks for your help
That did the job!!
cheers!
Sam