cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate number of days between two dates

former_member463021
Participant
0 Kudos

Hello,

I'd like to get a report that it calculates number of days between two dates.

One of them (date1) it hasn't values in a infoprovider, it is a user variable.

When a user executes the query, it shows a variable, user introduces a date (date1), and report shows a calculated ratio = date1 - date2 (date2 values are saved in a infoprovider).

The report hasn't filters.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member206568
Participant
0 Kudos

Hi Pedro,

I have not tested this. Maybe you can try and see if this works. Create two formula variables as follows:

Variable 1 - For the date in your InfoProvider. Make this a replacement path variable with the reference characteristic as the date field in your InfoProvider, replace InfoObject value key and dimension as date.

Variable 2 - Formula variable of type user entry. In this also keep dimension as date.

Create new formula Days = Variable 1 - Variable 2

Thanks!

former_member463021
Participant
0 Kudos

Thanks Loed,

It works!.

Loed
Active Contributor
0 Kudos

Huh? That's not me mate..

Anyway, good to know that your issue is already solved..

Regards,

Loed

Answers (1)

Answers (1)

Loed
Active Contributor
0 Kudos

Hi,

First, convert your DATE2 to KF..Follow the document below..

Then create another formula variable but instead of choosing INFOOBJECT in the replacement path tab, choose VARIABLE, enter the variable of your DATE1.

Then you may now create a formula to subtract the two (2) formula variables (FV)..

FORMULA = DATE1_FV - DATE2_FV

Regards,

Loed