Attribution
Description
The td_attribution_sqle()
function is used in web page analysis, where it lets
companies assign weights to pages before certain events, such as
buying a product.
Usage
td_attribution_sqle (
data = NULL,
data.optional = NULL,
data.optional2 = NULL,
data.optional3 = NULL,
data.optional4 = NULL,
conversion.data = NULL,
excluding.data = NULL,
optional.data = NULL,
model1.type = NULL,
model2.type = NULL,
event.column = NULL,
timestamp.column = NULL,
window.size = NULL,
...
)
Arguments
data |
Required Argument. | |||||||||||||||||
data.optional |
Optional Argument. | |||||||||||||||||
data.optional2 |
Optional Argument. | |||||||||||||||||
data.optional3 |
Optional Argument. | |||||||||||||||||
data.optional4 |
Optional Argument. | |||||||||||||||||
conversion.data |
Required Argument. | |||||||||||||||||
excluding.data |
Optional Argument. | |||||||||||||||||
optional.data |
Optional Argument. | |||||||||||||||||
model1.type |
Required Argument.
Types: tbl_teradata | |||||||||||||||||
model2.type |
Optional Argument.
Types: tbl_teradata | |||||||||||||||||
event.column |
Required Argument. | |||||||||||||||||
timestamp.column |
Required Argument. | |||||||||||||||||
window.size |
Required Argument. | |||||||||||||||||
... |
Specifies the generic keyword arguments SQLE functions accept. persist: volatile: Function allows the user to partition, hash, order or local order the input data. These generic arguments are available for each argument that accepts tbl_teradata as input and can be accessed as:
Note: |
Value
Function returns an object of class "td_attribution_sqle"
which is a named list containing object of class "tbl_teradata".
Named list member(s) can be referenced directly with the "$" operator
using the name(s):result
Examples
# Get the current context/connection.
con <- td_get_context()$connection
# Load the data to run the example
loadExampleData("attribution_example", "attribution_sample_table1",
"attribution_sample_table2" , "conversion_event_table",
"optional_event_table", "model1_table", "model2_table")
# Create tbl_teradata object
attribution_sample_table1 <- tbl(con, "attribution_sample_table1")
attribution_sample_table2 <- tbl(con, "attribution_sample_table2")
conversion_event_table <- tbl(con, "conversion_event_table")
optional_event_table <- tbl(con, "optional_event_table")
model1_table <- tbl(con, "model1_table")
model2_table <- tbl(con, "model2_table")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Assign attribution weights to events and channels.
attribution_out <- td_attribution_sqle(data=attribution_sample_table1,
data.partition.column="user_id",
data.order.column="time_stamp",
data.optional=attribution_sample_table2,
data.optional.partition.column='user_id',
data.optional.order.column='time_stamp',
event.column="event",
conversion.data=conversion_event_table,
optional.data=optional_event_table,
timestamp.column = "time_stamp",
window.size = "rows:10&seconds:20",
model1.type=model1_table,
model2.type=model2_table)
# Print the results.
print(attribution_out$result)