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

1 Solution

Accepted Solutions
sunny_talwar

Can you see if this works

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

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

View solution in original post

29 Replies
prieper
Master II
Master II

not clear on the required outcome:

Do you wish to know the days btw both dates? and then divide by 7? what to do with decimals?

Or do you wish to know the number of weeks elapsed betw the events?

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

I want to allocate days on the basis of Start and Finish date and respectively it should allocate to the standard weeks.

For desired result, look into the attachment.

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

gwassenaar

Plz help on this

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

stalwar1

plz help in this issue

Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand
sunny_talwar

Can you see if this works

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

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

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

Can explain the logic plz...

sunny_talwar

Sorry for not being very helpful... but if you really want to understand, you can look at the values generated by each part of the expression to see what they show and why I used them

1) Weekend >= Start and WeekStart <= Finish


2) Round(Finish - WeekStart)


3) Round(Finish - WeekStart)


4) Round(Weekend - Start)


5) RangeMax(Before(TOTAL Round(Weekend - Start)), 0)

and then build it from there.... that is exactly what I did

mohammadkhatimi
Partner - Specialist
Partner - Specialist
Author

yeah ur rite..i cn understand by this way..bt my concern was to understand ( - ) minus sign what indicate between two if condition