cancel
Showing results for 
Search instead for 
Did you mean: 

Webi 14.2.3 Count object between 2 Dates

10-04-2017 7:29 PM
2907 views 5 comments
0 Likes
SAP Managed Tags
Subscribe

Hello Team,

Since this morning I try to find a solution to count object between two dates.

But I can't found a solution.

To explain you I created an Excel file with my data and a result tab. But I can't attach an Excel File.

Can you help me please ?

data-example.txt

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Likes

Hi ,

Is start and End dates are separate columns in data ?

If yes ,below logic will work .

=Sum(If([Occurance Date]<=[End Date]) And (([Occurance Date]>=[Start Date])) Then ([Element]) ForEach([Incident]))

we can compare dates same way as in Excel !

Regards

Sateesh

Former Member
0 Likes

Hello Thanks a lot for your feedback, I have an issue regarding your answer

As you can see for me [End Date] in your formula =[Occurrence Date (Date Only)]

and [-28] = RelativeDate([Occurrence Date (Date Only)];-28)

=Sum(If([Occurrence Date (Date Only)]<=[Occurrence Date (Date Only)]And [Occurrence Date (Date Only)]>=[-28]) Then [NbIncident] ForEach([BT Incident]))

You think it is the reason that your formula = same value that [NbIncident]

Former Member
0 Likes

Hi ,

what are the start and end dates ?

you are comparing same object ,[Occurrence Date (Date Only)]<=[Occurrence Date (Date Only)] . I think it is incorrect ,as it always be TRUE.

we should use only date object itself instead of number to compare .

Ex : [Occurrence Date (Date Only)]>=[-28] is incorrect .[Occurrence Date (Date Only)]>=relativedate([Occurrence Date (Date Only)];[-28]

Regards

Sateesh

Former Member
0 Likes

Hi,

Start Date is [Occurrence Date (Date Only)]-28days

End Date is [Occurrence Date (Date Only)]

I write again my formula, But I receive only the counting Incident related only the incidents created the [Query 2].[Occurrence Date (Date Only)]

=Sum(If([Query 2].[Occurrence Date (Date Only)]<= [Query 2].[Occurrence Date (Date Only)] And [Query 2].[Occurrence Date (Date Only)]>=RelativeDate( [Query 2].[Occurrence Date (Date Only)];-28)) Then ([Nb Incident] ForEach([BT Incident])))

It is possible to arrange a meeting (10min) to explain my request in my context ?

Former Member
0 Likes

Now its interesting ! .

are you using 2 queries ? did queries merged ?