If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Prompt for week, calculate on date

Started by JZB-KRG, 19 Jun 2013 08:42:17 AM

Previous topic - Next topic

JZB-KRG

Hi,

I'm trying to figure out how I can make a solution where I can prompt for week and year and then calculate on date...

I have the following data items:

[Calendar Year]
[Calendar Week]
[Calendar Date]
[Calendar Weekday] (Monday, Tuesday, etc.)

So if I make a prompt saying
[Calendar Year] = ?Year?
[Calendar Week] = ?Week?
[Calendar Weekday] = 'Monday'

Then I will always get the first date of the week and the result will be (Year = 2013, Week = 26):

[Calendar Year] = 2013
[Calendar Week] = 26
[Calendar Date] = 24/06/2013
[Calendar Weekday] = Monday

Now I introduce:
[Payment Due Date]
[Amount]

If I then want to look at Payment Due Date in different intervals - for instance this week, next week and the week after - I would like to prompt for week and then say something like:

[This Week]
IF ([Payment Due Date] >= [Calendar Date] AND [Payment Due Date] <= _ADD_DAYS ([Calendar Date], 6))
THEN ([Amount])
ELSE (NULL)

[Next Week]
IF ([Payment Due Date] >= _ADD_DAYS ([Calendar Date], 7) AND [Payment Due Date] <= _ADD_DAYS ([Calendar Date], 13))
THEN ([Amount])
ELSE (NULL)

This way I will add the days to a date which means that I don't have to worry about the transitions between years.

BUT... It won't work. Any ideas?

I can make a solution where I prompt for date, but this is not what I want. For security reasons it has to be week I prompt for.

Best regards,

Jacob