Download Reportworq

This is the archived documentation for Reportworq 5. It is kept for reference and is no longer updated.

Go to the Reportworq 6 documentation

Data Collection#

Reportworq supports several functions that are used to "writeback" data into configured SQL data sources. These formulas are only available and executed when Reportworq receives a file for processing using a Reportworq Data Collection license.

Tap or click the image to view it full screen

SQL Datasources (SQL Server, ODBC or OleDB)#

The functions described in this section are specific to SQL datasources (SQL Server, ODBC or OleDB).

RW.Relational.Export#

RW.Relational.Export aka RWSQL executes a SQL query and imports the result set into an Excel range or named table. If you are on version 5.0.0.91 or earlier use RWSQL.


Syntax#

=RW.Relational.Export(targetRange, connectionName, query)

Arguments#

#NameTypeDefaultDescription
1targetRangeRange / table(required)Output range or named table.
2connectionNameString(required)Configured SQL connection name.
3queryString(required)SQL query text.

Behavior#


Usage notes#


Examples#

=RW.Relational.Export(A1, "DefaultConnection", "SELECT * FROM Sales WHERE Year = 2026")
=RW.Relational.Export(SalesTable, "WarehouseDB", "SELECT CustomerID, Amount FROM Orders")

Common mistakes#

SituationResult
Invalid target range or table nameFormula errors before the query runs
Blank query textFormula errors
Query returns more data than expectedImported data expands into the target area

Tap or click the image to view it full screen

RW.Relational.Update#

RW.Relational.Update aka RWSQLUpdate writes values back to SQL by updating the row that matches a key column and key value. If you are on version 5.0.0.91 or earlier please use RWSQLUpdate.


Syntax#

=RW.Relational.Update(connectionName, table, idColumnName, idColumnValue, columnName1, value1, [columnName2, value2], ...)

Arguments#

#NameTypeDefaultDescription
1connectionNameString(required)Configured SQL connection name.
2tableString(required)Table to update.
3idColumnNameString(required)Key column used in the match condition.
4idColumnValueValue(required)Key value to match.
5+columnName, valueRepeating pairs(required)One or more column/value pairs to update.

Behavior#


Usage notes#


Examples#

=RW.Relational.Update("DefaultConnection", "Users", "UserID", 123, "Email", "new@email.com")
=RW.Relational.Update("CRM", "Accounts", "AccountID", A1, "Manager", B2, "Territory", C3, "Priority", "High")

Common mistakes#

SituationResult
Fewer than 6 argumentsFormula errors during parsing
Blank connection, table, key name, or key valueFormula errors during parsing
Odd number of trailing column/value argumentsThe unmatched trailing item is ignored

RW.Relational.Upsert#

RW.Relational.Upsert aka RWSQLUpsert writes values back to SQL by updating an existing row or inserting a new row when the key does not already exist. If you are on version 5.0.0.91 or earlier please use RWSQLUpdate.


Syntax#

=RW.Relational.Upsert(connectionName, table, idColumnName, idColumnValue, columnName1, value1, [columnName2, value2], ...)

Arguments#

#NameTypeDefaultDescription
1connectionNameString(required)Configured SQL connection name.
2tableString(required)Table to update or insert into.
3idColumnNameString(required)Key column used in the match condition.
4idColumnValueValue(required)Key value to match or create.
5+columnName, valueRepeating pairs(required)One or more column/value pairs to write.

Behavior#


Usage notes#


Examples#

=RW.Relational.Upsert("AnalyticsDB", "Forecasts", "ForecastID", "Q3_2026", "Revenue", 5000000, "Confidence", 0.95)
=RW.Relational.Upsert("CRM", "Accounts", "AccountID", A1, "Status", "Active", "Territory", B2)

Common mistakes#


Feedback on this page

Comments, questions, requests, or something missing or unclear? Email us - the page you are on is filled in for you.

Email feedback on this page

Or write to support@reportworq.com directly.