Fetching data on the base of selected duration

5
Hey everyone,    I have use case where I want to retrieve data on the base of multiple filters together,          I want to impliment the logic in such a way that, I can choose the number of months since when I can fetch data from, and then     in those months i can again filter them on the base of dates,          for example,          In the first filter i can choose 4 months( data should be of last 4 months) and then I can choose dates ( suppose 7th and 10th)     So, in my listview, I should be able to get data from 7th to 10th of last 4 months, so 12 rows  of data should be there.          Thanks in advance      for any help 
asked
3 answers
1

Hi Rishabh,

As chandresh said, You can impliment a dynamic filter and then impliment it using a NPE,

What you can do is, Make an NPE and Set it’s attribut on the base of what you to filter.

Now, on the page where you want to show the data put a data view and set its Source as a microflow, Act_CreateFilter,
int the microflow, add a create object activity,  which creates the filter object. Now in the data view put a text box, which sets the filter attribute, Apply an on change event on all input widgets to call a microflow, which refreshes the filter object.

Now, put the list view and nest it inside the dataview and in the microflow which populates the list view, add the parameter of filter object  and in the end of your microflow add a filter object.

This way you’ll be able to filter your list dynamically.

 

Hope it helps you!

answered
2

Hi Rishabh,

You can implement this by using a NPE and then filtering data on the base of the attributes selected.

 

GO make it!

answered
1

Hi Rishabh,

  • Add custom filter to the filter it using months
  • Add a microflow to retrieve the records based on the entered month
  • try ‘month from datetime’ xpath in the retrieve activity to fetch the records from the entered month

Check the below link for reference

https://docs.mendix.com/refguide/xpath-month-from-datetime/

 

Also if needed, you can also check

Day from DateTime:

https://docs.mendix.com/refguide/xpath-day-from-datetime/

Year from DateTime:

https://docs.mendix.com/refguide/xpath-year-from-datetime/

 

Hope it helps!!!

answered