Skip to main content

I have calculated the date difference between last load ("Table1"."Column1") and today: DATEDIFF(dd, "Table1"."Column1", TODAY() ). I would like to apply a component filter to my OLAP table to see only the newest cases. I have tried with FILTER MIN(DATEDIFF(dd, "Table1"."Column1", TODAY() )); but no result. How should I reformulate my filter to get rid of the error I get?

imageimage2

image2


The question would be what do you mean by latest, in the filter function you have not defined the condition i.e. the syntax should look something like this

 

FILTER (DATEDIFF(dd, "Table1"."Column1", TODAY() )) <= 5


If you want to sort the newest cases in the OLAP table, you can put the order from largest to smallest like in the image.

image


The question would be what do you mean by latest, in the filter function you have not defined the condition i.e. the syntax should look something like this

 

FILTER (DATEDIFF(dd, "Table1"."Column1", TODAY() )) <= 5

By latest I mean the newest cases from today, so in my case it would be 2021-12-09 (two rows)


By latest I mean the newest cases from today, so in my case it would be 2021-12-09 (two rows)

You can directly filter your table for today in that case, assuming both are in the same format this should work

 

FILTER "Table1"."Column1" = TODAY()


I've found a solution: FILTER "Table1"."Column1"  = PU_LAST("Table2", ""Table1"."Column1", ORDER BY "Table1"."Column1"). DATEDIFF is not necessary, I got rid of it.

Finally my OLAP table shows only the newest cases, exactly what I needed. I share this solution because it may be useful also for other Celopeers :)


Reply