Skip to main content
Inspiring
August 19, 2022
Question

Filters and Stored Procedure

  • August 19, 2022
  • 7 replies
  • 0 views

I am exporting data from DB and storing into excel , in Export DSE to Excel smart service i need to add filters which will only export data for last month . How can i add this filtter to it .

One Stored Procedure need to create which will delete the dats for last month after fetching from DB . How to create this for 2 different entities which will delete data for last month.

7 replies

harshitb6843
August 19, 2022

You can use the 'filters' input in the configurations to configure it. Here is the documentation about the same - docs.appian.com/.../Export_To_Excel_Smart_Service.html

Inspiring
August 19, 2022

so , will it be like a!queryFilter(now()-1) for getting last months data .If the process runs once on start of each month

harshitb6843
August 19, 2022

a!localVariables(
  local!endOfMonth: eomonth(now(), 0),
  local!splittedDate: split(local!endOfMonth, "/"),
  local!endDateWithTime: datetime(
    local!splittedDate[3],
    local!splittedDate[1],
    local!splittedDate[2],
    "23",
    "59",
    "59",
    "59"
  ),
  a!queryLogicalExpression(
    operator: "AND",
    filters: {
      a!queryFilter(
        field: "createdOn_dtm",
        operator: "<",
        value: local!endDateWithTime
      ),
      a!queryFilter(
        field: "createdOn_dtm",
        operator: ">",
        value: datetime(year(now()), month(now()), 1, 00, 00, 00, 00)
      )
    }
  )
)