Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have created a sample QVW attached to this post with a simple table (as shown in below screenshot). I am trying to create a logic where I would have to divide the "Hrs" equally among the months between the Start & End Date (As shown in next screenshot). Anybody has an idea how I can do it at script level.
Thank you.
@divya_anand wrote:Start Date: 6/1/2018;
End Date: 6/1/2019;
Hence No. of Months=13
How is no of months = 13 here? From a date in 2018 to the same date in 2019, shouldn't it be just 12 months flat? I am confused?
Would you be able to give another example... I guess for project B to show how that one will play out?
Yes ma'am
Try this
Left Join(Data) Load Project, %DATE_KEY, If(MonthStart(Start, Floor(Only(MonthsDiff)/3)) > %DATE_KEY, Only(Hrs) * 0.60, If(MonthStart(Start, Floor(Only(MonthsDiff)/3)*2) > %DATE_KEY, Only(Hrs) * 0.25, Only(Hrs) * 0.15))/Floor(Only(MonthsDiff)/3) as Value Resident Data GROUP BY Project, %DATE_KEY, Start;
I think a good explanation is part of getting to the correct answer quickly. A lot of the time people just think that they can put anything out there and can expect to get a response which will work for them. So, kudos to you for spending time to go over in details as to what you have and what you needed.