Skip to main content
April 24, 2024
Question

Using filter in the record, count the days from date range

  • April 24, 2024
  • 7 replies
  • 0 views

HI,
 I have a question regarding the Filters.
Like I have table of name Employee and it has column -ID,Name,JoiningDate and LastDate.

So Is there any way to count the number of working days of the emplyoee and show on the Interface in the records.
Using filters as well,

7 replies

karumurua531442
April 24, 2024

 hi [mention:05ec0292a76349c3b810baa88e2b75f7:e9ed411860ed4f2ba0265705b8793d05]  Are you try to show the number of working days using the Joining date and last date columns?

April 24, 2024

yes

konduruc733182
April 24, 2024

Hello [mention:05ec0292a76349c3b810baa88e2b75f7:e9ed411860ed4f2ba0265705b8793d05] 

Yes, you can do that. use custom record fields to calculate this. And for the filters you would need to have a range where the days should fall in between.

April 24, 2024

Can you please brifly explain how I can pass date from the Interface if range is created?

konduruc733182
April 24, 2024

Something like above. Calculate the date difference using a custom record field and create a user filter.

Example code for User filter-Update accordingly

a!localVariables(
  local!days: a!forEach(
    items: enumerate(10) + 1,
    expression: fv!item * 100
  ),
  a!recordFilterList(
    name: "Number of Days",
    options: a!forEach(
      items: local!days,
      expression: a!recordFilterListOption(
        id: fv!index,
        name: concat("<", fv!item, " Days"),
        filter: a!queryFilter(
          field: 'recordType!KS Sample.fields.Days',
          operator: "<",
          value: fv!item
        )
      )
    )
  )
)

Custom field using sync-time evaluation. just a normal date difference by subtraction your last date and joining date and format using toInteger()

mathieud0001
April 24, 2024

You can use the calworkdays function in a sync time Record field https://docs.appian.com/suite/help/24.1/fnc_date_and_time_calworkdays.html