Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mohammadkhatimi
Partner - Specialist
Partner - Specialist

Values between Start and Finish date

Hi,

My requirement is to capture count of days (week-wise) between Start and Finish date rest will be blank

Below is the output for reference:

Output.PNG

Application and data is attached.

Please do the needful ASAP

Thanks in Advance,

Regards,

Mohammad

29 Replies
sunny_talwar

This -> Round(Finish - WeekStart) generates a number which can exceed 7, so in order to get the week, I subtracted the days in previous week... there might be able another smart way to do this... but in the short spam of time I got, I came up with this

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

Ohh Okay...

Thank You so much for ur efforts.

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

Thanks..!!

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

Hi,

Everthing is working fine except for the calculation on last no.of days.

It should be Weekend-Finish, and with this change if the Finish date and weekend date is same then it gives me 1.

Please help me to resolve this.

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

stalwar1‌ kindly look into this..

sunny_talwar

Would you be able to pin-point in the application where the problem is?

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

As u select "Acti" as "Concept" in that weekend and finish date is same..

sunny_talwar

So instead of seeing a 6, you want to see 1?

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

To calculate the last no.of days, you used Finish-Weekstart.. it should be Weekend-Finish..to get the correct no. of days.

So, when I am using Weekend-Finish and if the finish date and weekend date is same then its showing 1..which should come as 7.Like wise you did it to calculate Start no.of days.

For.e.g Finish date is 17-10-2015 and weekend is also 17-10-2015.. So it took whole week to complete.. Therefore it should be 7.

Likewise if the date was 15-10-2015 and weekend is 17-10-2015, So the no.of days should be 3 days.

Hope you understand it.

sunny_talwar

If Finish = 17-10-2015 and weekend = 17-10-2015... and you do Weekend - Finish... you will get 0 (or 1 because you have timestamps)...

but if you use Finish = 17-10-2015 and WeekStart = 11-10-2015 and you do Finish - Weekend + 1... you might get what you are looking for

=If(Weekend >= Start and WeekStart <= Finish,

If(Round(Finish - WeekStart) <= 7, Round(Finish - WeekStart) + 1, Round(Weekend - Start)) - If(Round(Finish - WeekStart) <= 7, 0, RangeMax(Before(TOTAL Round(Weekend - Start)), 0)))