We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.
Hi All,
I am using the export datastore entity to excel smart service to export records from database. But it gives duplicate records. I am using the filter condition as given below in data input section of smart service:
= a!queryLogicalExpression( operator: "AND", filters: { if(isnull(pv!study), {}, a!queryFilter( field: "study", operator: "in", value: pv!study ) ), if(isnull(pv!category), {}, a!queryFilter( field: "rootCauseCategory", operator: "in", value: pv!category) ), if(isnull(pv!siteDepotLoc), {}, a!queryFilter( field: "siteDepotLoc", operator: "in", value:pv!siteDepotLoc ) ), if(isnull(pv!excursionType), {}, a!queryFilter( field: "excursionType", operator: "in", value: pv!excursionType ) ), a!queryFilter( field: "dateReported", operator: "between", value: { pv!dateReportedFrom, pv!dateReportedTo }, applywhen: not( or( rule!APN_isEmpty(pv!dateReportedFrom), rule!APN_isEmpty(pv!dateReportedTo) ) )), if(isnull(pv!otherRootCause), {}, a!queryFilter( field: "otherRootCause", operator: "in", value: rule!APN_distinct(pv!otherRootCause) ) )})
Can anyone please suggest ho to remove the duplicate records.
Thank you
Discussion posts and replies are publicly visible
I would typically utilize the view method as described by Mike, however to note you can also apply a!queryAggregation() within the aggregation parameter of the Export DSE to Excel node (or function), adding isGrouping: true for all of your columns will eliminate duplicates.
a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "requestNumber", isGrouping: true ), a!queryAggregationColumn( field: "submitterId", isGrouping: true ) } )