Table2Base: Difference between revisions

From Opasnet
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{tool|moderator=Juha Villman}} [[category:extension]]
{{tool|moderator=Juha Villman}}  


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


==Usage==
== Usage ==


'''Example:'''
'''Example:'''  
<pre>
<pre>&lt;t2b numeric="yes" index="Year,Country" unit="###" obs="Mortality"&gt;
<t2b numeric="yes" index="Year,Country" unit="###" obs="Mortality">
2001|Finland|1000
2001|Finland|1000
2002|Finland|2000
2002|Finland|2000
2001|Sweden|900
2001|Sweden|900
2002|Sweden|800
2002|Sweden|800
</t2b>
&lt;/t2b&gt;
</pre>
</pre>  
'''Displays:'''
'''Displays:''' <t2b numeric="yes" index="Year,Country" unit="###" obs="Mortality">
<t2b numeric="yes" index="Year,Country" unit="###" obs="Mortality">
2001|Finland|1000
2001|Finland|1000
2002|Finland|yes
2002|Finland|yes
2001|Sweden|900
2001|Sweden|900
2002|Sweden|800
2002|Sweden|800
</t2b>
</t2b>  


'''Notes:'''
'''Notes:'''  
*'''numeric''' defines if result is numeric or not
 
** if not defined default "yes" is used
*'''numeric''' defines if result is numeric or not  
** optional
**if not defined default "yes" is used  
** if you have text in your result set this to "no"
**optional  
*'''index''' argument defines indices of the datatable:
**if you have text in your result set this to "no"  
** example has 2 indices: Year and Country
*'''index''' argument defines indices of the datatable:  
** it is obligatory to have at least 1 index
**example has 2 indices: Year and Country  
*'''unit''' defines the unit of the variable
**it is obligatory to have at least 1 index  
** it is obligatory to define unit
*'''unit''' defines the unit of the variable  
*'''obs''' defines the name of the result column
**it is obligatory to define unit  
** obs is optional
*'''obs''' defines the name of the result column  
** if not defined default value "Result" is used
**obs is optional  
*Data is saved only when table is altered and page is saved
**if not defined default value "Result" is used  
*Number of data columns must match to number of indices + result column
*Data is saved only when table is altered and page is saved  
*Each row must have equal number of columns
*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
*Table caption is a link to Base UI


<br> '''Hints for spreadsheet software'''


'''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.


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
:="&lt;tb2 index="&amp;CHAR(34)&amp;A1&amp;","&amp;B1&amp;","&amp;C1&amp;CHAR(34)&amp;" unit="&amp;CHAR(34)&amp;"kg"&amp;CHAR(34)&amp;" obs="&amp;CHAR(34)&amp;D1&amp;CHAR(34)&amp;"&gt;"
;Formula for the second row and beyond
:=A2&amp;"|"&amp;B2&amp;"|"&amp;C2&amp;"|"&amp;D2


;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)&">"
== See also ==
;Formula for the second row and beyond:=A2&"|"&B2&"|"&C2&"|"&D2


==See also==
*[http://en.opasnet.org/en-opwiki/index.php?title=Table2Base&oldid=17451 Previous dicussion about the format of the table]


* [http://en.opasnet.org/en-opwiki/index.php?title=Table2Base&oldid=17451 Previous dicussion about the format of the table]
== Keywords ==


==Keywords==
== References ==


==References==
<references />


<references/>
== Related files ==


==Related files==
{{mfiles}}


{{mfiles}}
[[Category:Extension]]

Revision as of 13:04, 24 March 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 numeric="yes" index="Year,Country" unit="###" obs="Mortality">
2001|Finland|1000
2002|Finland|2000
2001|Sweden|900
2002|Sweden|800
</t2b>

Displays:

Table2Base: Difference between revisions(###)
ObsYearCountryMortality
12001Finland1000
22002Finlandyes
32001Sweden900
42002Sweden800

Notes:

  • numeric defines if result is numeric or not
    • if not defined default "yes" is used
    • optional
    • if you have text in your result set this to "no"
  • 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>