Quantcast
Channel: SCN : Discussion List - SAP BusinessObjects Web Intelligence
Viewing all articles
Browse latest Browse all 5402

Incorrect results for days between two days excl & inclwkend

$
0
0

Hi,

 

We have 3 Data providers DP1, DP2,DP3 with measures along with EquipId.

I have to show

 

In DP1, we have Equip_Id, EffstDt, EffEndDt

 

We have to calculate the Equip used for 4 Quarters. First Quarter from Jan to Mar

 

We have to calculate the no of days between Q3CalStDt and Q3CalEndDt including and excluding weekends.

if Equip_Id is utilized on the same day i.e. Q3CalStDt=7/7/2014 and Q3CalEndDt=7/7/2014 then no of days=1 is included in formula where as days_between function returns 0

 

The below results are for Days between Excluding weekends are correct for Equpids 63,33


Q3StDt,Q3EndDt, Q3CalStDt, Q3CalEndDt are calculated based on EffStDt,EffEndDt of EquipId

 

when I drag

EquipId,EffStDt,EffEndDt,Q3StDt,Q3EndDt Qt3CalStDt, Q3CalEndDt,Q3Used

   63     6/6/2014 2/31/99  7/1/2014  9/30/2014   7/1/2014   9/30/2014     66

   33     8/4/2014 12/31/99 7/1/2014   9/30/2014  8/4/2014   9/30/2014    42

   232   5/12/2014 5/15/2014                                                                     1                                 

   232   5/16/2014  5/19/2014                                                                     1     

  232  7/2/2014  12/31/99 7/1/2014 9/30/2014  7/2/2014    9/30/2014    65

   675  6/1/2014  6/5/2014                                                                    1

  675  6/6/2014  6/28/2014                                                                  1                                

 

EquipId 232, 675 EffStDt,EffEndDt does not fall under Q3 Qtr i.e. July to Sept, but formula Q3Used returns 1

 

When I drag EquipId and Q3Used, Here Equipid is merged dimension from (3) Data providers.

I am getting incorrect results

 

Equipid,Eqp_Used

63          66

33         42

232       66

675        1

 

Report Output

 

EquipId,DP1_measure1, DP2measure,DP3 measure, Q3Used, Q2Used,Q3Used,Q4Used

 

Calculation of  Q3Used based on two [Q3CalStDt]; [Q3CalEndDt] dates which fall in the Q3 Qtr i.e. July to Sept

 

Q3Used=  (If([Prompt for Weekends]="N"   )  Then Sum((Truncate(DaysBetween([Q3CalStDt]; [Q3CalEndDt]) / 7 ; 0) * 5)+ ToNumber(Substr

("123455512344451233345122234511123450012340123455"; ((DayNumberOfWeek([Q3CalStDt])-1)*7)+Mod(DaysBetween([Q3CalStDt];

[Q3CalEndDt]);7)+1 ; 1))  ForEach([EquipId];[Q3CalStDt];[Q3CalEndDt]))  Else Sum((DaysBetween

([Q3CalStDt];RelativeDate([Q3CalEndDt];1) )  ForEach([EquipId];[Q3CalStDt];[Q3CalEndDt])  ) ))


Viewing all articles
Browse latest Browse all 5402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>