Table2Base: Difference between revisions

From Opasnet
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:
'''Displays:'''  
'''Displays:'''  
<t2b index="Year,Country" unit="#" obs="Mortality">
<t2b index="Year,Country" unit="#" obs="Mortality">
2001|Norway|101
2001|Norway|toimi
2002|Finland|100
2002|Finland|100
2001|Sweden|600
2001|Sweden|600

Revision as of 10:20, 14 November 2011


Table2Base is an extension which enables direct upload of data from wikipages to Opasnet Base. Data is displayed as a table in wikipage.

Usage

Example:

<t2b index="Year,Country" unit="#" obs="Mortality">
2001|Finland|100
2002|Finland|100
2001|Sweden|600
2002|Sweden|800
</t2b>

Displays:

Table2Base: Difference between revisions(#)
ObsYearCountryMortality
12001Norwaytoimi
22002Finland100
32001Sweden600
42002Sweden800

Notes:

  • index argument defines indices of the datatable:
    • example has 2 indices: Year and Country
    • it is obligatory to have at least 1 index
  • unit defines the unit of the variable
    • it is obligatory to define unit
  • obs defines the name of the result column
    • obs is optional
    • if not defined default value "Result" is used
  • Data is saved only when table is altered and page is saved
  • Number of data columns must match to number of indices + result column
  • Each row must have equal number of columns
  • Table caption is a link to Base UI


Hints for spreadsheet software

If you have your data table in Open Office Calc, Excel, or some other software, you can use these formulas to convert tables into Table2Base code. This example is for Excel, other software may have slightly different syntax. Here, the data is in the spreadsheet in columns A...D. Columns A...C contain index values and column D observations. The first row contains index names and rows starting from row 2 contain data.

Formula for the first row
="<tb2 index="&CHAR(34)&A1&","&B1&","&C1&CHAR(34)&" unit="&CHAR(34)&"kg"&CHAR(34)&" obs="&CHAR(34)&D1&CHAR(34)&">"
Formula for the second row and beyond
=A2&"|"&B2&"|"&C2&"|"&D2

See also

Keywords

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>