Need to get queue count through LINQ

Hi,

This is an export from Export Queue Items.
Can i get help for generating count of successful transactions for a specified date range.I am strugling at the DateTime while forming the query.

Example i need all success count from Date1 to Date2 by having the reference as started column from excel.

@JITU99
Excel Application Scope
File Path: “path_to_your_file.xlsx”
Read Range
Output: dtData

Variables
startDate (Type: DateTime) = new DateTime(2023, 5, 16)
endDate (Type: DateTime) = new DateTime(2023, 5, 17)
status (Type: String) = “Successful”
successCount (Type: Int32)

Assign Activity
successCount = dtData.AsEnumerable().Where(Function(row) DateTime.Parse(row(“Started”).ToString()) >= startDate And DateTime.Parse(row(“Started”).ToString()) <= endDate And row(“Status”).ToString() = status).Count()

Message Box
Text: successCount.ToString()

What should I take the Date1 and Date2? @JITU99

Regards

@JITU99

please try this

  1. Read data into dt
  2. requiredcount = dt.AsEnumerable.Where(function(x) x("Status").ToString.Equals("Successful") AndAlso Cdate(x("Started").ToString) > Date1 AndAlso Cdate(x("Started").ToString) < Date2).Count

Here date1 and date2 are variable in dateformat

cheers

1 Like

Hi @JITU99

If date1 and date2 are fixed and if you want to use the excel data, then you can use the process suggested by @Anil_G

If you want to get the data directly from the orchestrator, then use the get queue items and lets take the output of that activity as queueItems and pass the from and to dates in the properties panel of the Get Queue Items and it works!!

After getting the queue data use the below syntax in using assign activity and you can get the success count.

successCount = queueItems.Count(Function(item) item.Status = QueueItemStatus.Successful)

Regards

2 Likes

when it is about the count only for successfully processed queueitems within a particular range we can get it directly by single REST API call to Orchestrator

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.