[SOLVED] - Subtract days to prompt date

Hello,

As you can see I’m new with universe desginer.
I’m usig a Oracle db. I need to subtract x days to a prompt date to do the query.

For example, user will write 05/01/2012-10/01/2012 and I need the information of two days before. (03/01/2012-10/01/2012)

Could you help me?

Thank you


Toxicosmos (BOB member since 2012-08-21)

Hi,

Are you taking two user inputs or one input value for date range. In case if it is two prompts then for the first prompt defenition you can define it on Universe level itself. The defenition of the first filter will be (@prompt() - x) and defenition of second filter will be @prompt().

The report level condition will be your date between filter1 and filter2.


saurabhg :india: (BOB member since 2007-04-02)

Thank you!

I’m going to try it


Toxicosmos (BOB member since 2012-08-21)

As I’ve said, I’m new in this stuff
I’m trying with that code. I’ve created a new class (Util) and a new object (USER_PROMPT_DATE). My intention is to use this object as a condition in a report.

UTIL.USER_PROMPT_DATE between @Prompt(‘BEGIN_DATE’,‘D’,‘UTIL\USER_PROMPT_DATE’,mono,free) -3 AND
@Prompt(‘END_DATE’,‘D’,‘UTIL\USER_PROMPT_DATE’,mono,free)

It’s not parsing its shows this error message:
Invalid definition (UNV0023). This class does not exist. (UNV0037)
I’ve created the class and the objects, and the names are correct

Could you help me with that?

Thank you


Toxicosmos (BOB member since 2012-08-21)

Well,

I would say Please check the Parameter value and I also suggest you to please select Objects name to Object class Panel. Do not write Manually.

Note: If it wont parse then restart the Designer and re-create the filter.

Hope it will work…
:idea:


lionskashif :pakistan: (BOB member since 2011-01-21)

Hi,

thank you lionskashif, now it’s parsing, the problem was a typing error. I have done copy-paste and it parses.

Now it’s not doing the subtract my code is.

(@Select(Issue Activity Log\Issue Activity Log Issue Tiempo Sistema) between @Prompt(‘Earliest Measurement Date’, ‘D’,‘Issue Activity Log\Issue Activity Log Issue Tiempo Sistema’,mono,free)-3 AND @Prompt(‘Latest Measurement Date’, ‘D’,‘Issue Activity Log\Issue Activity Log Issue Tiempo Sistema’ ,mono,free) )

I have put -3 and after I make the query the values are the same of the prompt. Ex; Start: 13/08/2012 End: 30/08/2012. Then in the report appears the same dates, It would be 10/08/2012-30/08/2012

Do you know if I’m doing the subtract wrong?

Thanks


Toxicosmos (BOB member since 2012-08-21)

Hi,

I’ve got the solution!

My problem was the CA database, I needed to use PdmAddDays() to subtract the days.

That’s the final code

(@Select(Issue Activity Log\Issue Activity Log Issue Tiempo Sistema) between PdmAddDays(@Prompt('Tiempo Sistema (Inicio)', 'D',,mono,free), -3) AND @Prompt('Tiempo Sistema (Fin)', 'D','Issue Activity Log\Issue Activity Log Issue Tiempo Sistema' ,mono,free) )

Thank you for your help!


Toxicosmos (BOB member since 2012-08-21)