filter aggregate by date range

Hi


I have added on date in an aggregate


There is filter in which i have to filter by from and to date between they were added

How can i achieve this ?

Use a filter like:

(FilterFromDate = NullDateTime() or AddedOnColumn >= FilterFromDate) and (FilterToDate = NullDateTime() or AddedOnColumn <= FilterToDate)

With a filter like this you can select a date or leave it empty (to have no From or To limit)

I am trying to add this filter its throwing error, can u please elaborate a little?

The FilterFromDate and FilterToDate should be your filter variables, in this case both DateTime types.

The AddedOnColumn should be renamed to your actual EntityColumn name.

After these changes, what are the errors you are receiving?

Perhaps provide a sample OML (save module, and add it here as reply)

As I see in your screenshot, your AddedOn column is of type DateTime, therefor filtering should be done with DateTime type filters. However, your filter screenshot shows only dates. Your filters should then use the function DateToDateTime:

The FromDate filter:

FilterFromDate = NullDate() or AddedOnColumn >= DateToDateTime(FilterFromDate)

And the ToDate filter:

FilterToDate = NullDate() or AddedOnColumn < DateToDateTime(AddDays(FilterToDate,1))

Explanation of the AddDays: When you want to have the whole day included in the ToDate filter (23:59:59). As seen in the above filter: It adds one day to the selected ToDate filter, converts that to a full datetime (with 00:00:00 time component) and compares it with the AddedOnColumn.

its not even filtering anything, it giving me empty table, is it necessary to create from and to date as an attribute in the entity 


I have used local variables to point this values.

The date filter inputs need to point to the local variables.

Without other screenshots it is difficult to solve this.

Here is a sample OML, maybe you can see anything you can use from it.

Could you provide a (simplified) OML to me that I can view?

FilterDates.oml

Thanks!!!! Its working

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.