Difference between revisions of "DbTable"
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Database Functions]] | [[Category:Database Functions]] | ||
− | + | {{ReleaseBar}} | |
− | ''(Requires Analytica | + | ''(Requires {{Analytica Developer}} or Power Player)'' |
− | = DbTable( dbIndex, column ) = | + | == DbTable(dbIndex, column) == |
− | = DbTable( dbIndex, columnList ) = | + | == DbTable(dbIndex, columnList) == |
− | = DbTable( dbIndex, columnIndex ) = | + | == DbTable(dbIndex, columnIndex) == |
− | DbTable() is used to get at the data within a result table. The first argument, | + | [[DbTable]]() is used to get at the data within a result table. The first argument, «dbIndex», must be the name of a Variable (normally an index) in your Analytica model that is defined with a [[DbQuery]]() statement. If the second argument, «column», is a text value, it identifies the name of a column label in the result table, in which case DbTable() returns a 1-D array (indexed by ''dbIndex'') with the data for that column. |
− | case DbTable() returns a 1-D array (indexed by dbIndex) with the data for that column | ||
− | |||
− | + | If the second argument is a list of text values (the «columnList» form), then [[DbTable]]() returns a 2-D table with records indexed by ''dbIndex'', and columns implicitly indexed (i.e., self-indexed/null-indexed). | |
+ | If the second argument is the name of an Analytica Variable (usually an index) whose value evaluates to a list of text values, those text values become the column headings for a 2-D table with columns indexed by «columnIndex», and rows indexed by ''dbIndex''. With this last form, «columnIndex» may be defined as [[DbLabels]](dbIndex). | ||
+ | |||
+ | == Library == | ||
Database Functions | Database Functions | ||
− | = See Also = | + | == See Also == |
− | + | * [[DbTableNames]] | |
* [[DbQuery]] | * [[DbQuery]] | ||
* [[DbLabels]] | * [[DbLabels]] | ||
+ | * [[Database functions]] | ||
+ | * [[Database access]] | ||
+ | * [[media:Db conversion lib.ana|DB conversion lib.ana]] | ||
+ | * [[Analytica_Libraries_and_Templates#DB_Conversion_Library|DB Conversion Library]] |
Latest revision as of 20:26, 1 July 2025
Release: |
• 4.6 • 5.0 • 5.1 • 5.2 • 5.3 • 5.4 • • 6.0 • 6.1 • 6.2 • 6.3 • 6.4 • 6.5 • 6.6 |
---|
(Requires Analytica Enterprise or Power Player)
DbTable(dbIndex, column)
DbTable(dbIndex, columnList)
DbTable(dbIndex, columnIndex)
DbTable() is used to get at the data within a result table. The first argument, «dbIndex», must be the name of a Variable (normally an index) in your Analytica model that is defined with a DbQuery() statement. If the second argument, «column», is a text value, it identifies the name of a column label in the result table, in which case DbTable() returns a 1-D array (indexed by dbIndex) with the data for that column.
If the second argument is a list of text values (the «columnList» form), then DbTable() returns a 2-D table with records indexed by dbIndex, and columns implicitly indexed (i.e., self-indexed/null-indexed).
If the second argument is the name of an Analytica Variable (usually an index) whose value evaluates to a list of text values, those text values become the column headings for a 2-D table with columns indexed by «columnIndex», and rows indexed by dbIndex. With this last form, «columnIndex» may be defined as DbLabels(dbIndex).
Library
Database Functions
Enable comment auto-refresher