Skip to main content

Hi,

 

I want to apply a component filter to an OLAP table. The table initially contains only the case key and the event time. The filter should ensure that only the cases from the last month are displayed.

 

I find the date of the last case with MAX("_CEL_O2C_ACTIVITIES". "EVENTTIME"). Then I subtract one month with ADD_MONTHS(MAX("_CEL_O2C_ACTIVITIES". "EVENTTIME"), -1). Up to this point everything works.

 

If I then set FILTER "_CEL_O2C_ACTIVITIES". "EVENTTIME" > ADD_MONTHS(MAX("_CEL_O2C_ACTIVITIES". "EVENTTIME"), -1) as the component filter, it tells me of course that you can't apply a MAX function in the filter. 

 

Is there a way to solve the problem anyway? Thanks a lot!

 

Many greetings

Lukas

Hi,

 

I don't know if I understood you correctly but:

 

1) If you want to show the data from the last 30 days, you can use the TODAY ().

Your filter should look like this.:

FILTER "_CEL_O2C_ACTIVITIES". "EVENTTIME" < ADD_MONTHS(TODAY(), -1)

 

2) If you want to show the data from previous month (ex. it is May and you would like to show data from April).

Then you can try something like this:

FILTER "_CEL_AP_ACTIVITIES". "EVENTTIME" > ROUND_MONTH ( ADD_MONTHS(TODAY(),-1));

FILTER "_CEL_AP_ACTIVITIES". "EVENTTIME" < ROUND_MONTH ( TODAY())

 

I believe there is a smarter way but it will do the work as well :)

 

Regards,

Marcin


Hey Marcin,

 

thanks for your answer!

 

The thing is, I'd like to solve it for a record that has no more entries on today. I would like to make it dependent on the date of the last case in the record. 

 

Maybe you have a solution for this as well, it would make me very happy!

 

Many greetings

Lukas 


You can try using CONSTANT()

It should look like this:

 

FILTER "_CEL_O2C_ACTIVITIES". "EVENTTIME" > ADD_MONTHS(PU_MAX ( CONSTANT ( ), "_CEL_O2C_ACTIVITIES"."EVENTTIME"),-1)

 

Regards,

Marcin

 


It worked, thank you Marcin!


Reply