I have an excel file on which i need to get an out which is obtained from the sql query :
SELECT TOP 25
cs-uri-stem as Url,
COUNT(*) As Hits
FROM ‘[LOGFILEPATH]’
GROUP BY cs-uri-stem
ORDER By Hits DESC
or is it possible to run this is a query on excel Datatable?
@Mahesh_Nag If you have an Excel File , We can Use Linq Query to perform Such an Operation. But for the Correct Linq Query, you’ll need to provide the Correct Column Names as present in the Excel File.
Use Build Datatable Activity with two Columns that you need as Above, say GroupByDT
Read the Excel File and get the Output Datatable as InputDT.
In An Assign Activity, Use this Linq Query:
GroupByDT = (From p In InputDT.AsEnumerable() Group By x= New With { Key.a =p.Item(“YourColumnName”)} Into Grp = Group Select GroupByDT.LoadDataRow (New Object() {grp(0)(1),grp.Count},False)).CopyToDataTable
The grp(0)(1) is the First Column value, So Depending on Where your Column is , you’ll need to Change the Index value
Then Write the GroupByDT variable to an Excel File using Write Range Activity.