Discussion Board for collaboration on QlikView Scripting.
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.
Go to Solution.
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).
You can find attached an app that hopefully answers your request.
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!
Thanks for your help
That did the job!!