Transforms are applied in order. The last entry should be a chart type. If no chart is specified, a table view of the data is shown.
Normally transforms will be one per line, but when used with HTCondorView.simple, they should be concatenated with ampersands ("&").
extract_regexp=ver=version-(.*)
would replace a
string version-25.4
in column ver
with the string 25.4
.
A clause like group=a,b;x,y
(if x is a string and y
is a number) would be equivalent to this in SQL: select
a, b, count(x) x, sum(y) y from MyTable group by a, b
If you apply multiple group= clauses, it works like using multiple nested subqueries in SQL. (That is, the output of one group= clause becomes the MyTable of the next one.)
If you leave out the ';' and the val column names, the default is to automatically include all columns other than the key columns.
If you include the ';' but leave out the val
column names, that means you don't want any value
columns (so only the key fields will be included, and
nothing will be summed or counted at that step). So
group=a,b;
(with a trailing semicolon) is equivalent
to this in SQL: select a, b from MyTable group by a,
b
.
The simplest way to think of a pivot table is like this: the values originally in the columns named by rowkeys end up down the left of the output table, one column per rowkey. The values originally in the columns named by colkeys end up as headings across the top of the output table, the values concatenated together with a space. The values originally in the columns named by valkeys end up as values in the body section of the output table. A pivot table is very handy when you have raw data in SQL-like format and you want to rearrange it to be suitable for charting (where each line in a line chart, say, is usually one column of the table).
If the rowkeys section is empty, the output will have exactly one row (with all the value fields counted or summed into that one row). If the colkeys section is empty, the pivot= operation is essentially equivalent to a group=rowkeys...;valkeys... operation. If the valkeys section is empty, there are no values used to calculate the table body, so it is equivalent to an group=rowkeys...; operation.
For example, given this data:
color | highlight | shape | size | count |
---|---|---|---|---|
green | black | cube | 2 | 1 |
red | white | cube | 1 | 4 |
red | white | sphere | 2 | 4 |
green | black | sphere | 2 | 2 |
green | white | sphere | 1 | 5 |
red | white | cube | 1 | 4 |
red | black | sphere | 2 | 3 |
red | white | cube | 1 | 3 |
green | white | cube | 1 | 2 |
green | black | sphere | 2 | 5 |
red | black | cube | 2 | 2 |
red | white | cube | 2 | 5 |
red | white | sphere | 1 | 1 |
green | black | cube | 1 | 4 |
red | black | cube | 1 | 4 |
red | black | cube | 2 | 2 |
green | white | sphere | 1 | 3 |
red | white | cube | 2 | 2 |
green | black | cube | 2 | 5 |
red | white | cube | 2 | 1 |
The pivot
pivot=color,highlight;shape,size;count
yields this table:
color | highlight | cube 2 | cube 1 | sphere 2 | sphere 1 |
---|---|---|---|---|---|
green | black | 6 | 4 | 7 | 0 |
red | white | 8 | 11 | 4 | 1 |
green | white | 0 | 2 | 0 | 8 |
red | black | 4 | 4 | 3 | 0 |
The following options are only used with HTCondorView.simple. In normal usage they are separate fields.