Welcome, Registration, and other StartingPoints; TWiki history & Wiki style; All the docs...
View   r8  >  r7  ...
SpreadSheetPlugin 8 - 03 Apr 2004 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Spreadsheet Plugin

This Plugin adds speadsheet capabilities to TWiki topics. Formulae like %CALC{"$INT(7/3)"}% are evaluated at page view time. They can be placed in table cells and outside of tables. In other words, this Plugin provides general formula evaluation capability, not just classic spreadsheet functions.

Changed:
<
<
Example:
>
>
Example:
 
Region: Sales:
Northeast 320
Line: 13 to 14
 
Asia 220
Total: 220
Added:
>
>
      Interactive example:

Formula: %CALC{""}%  
Result:     guest

 The formula next to "Total" is %CALC{"$SUM( $ABOVE() )"}%.
(you see the formula instead of the sum in case the Plugin is not installed or not enabled.)
Added:
>
>
 

Syntax Rules

Line: 58 to 74
 
"$LEFT()" The address range of cells to the left of the current cell
"$LENGTH(text)" The length in bytes of text. Example: %CALC{"$LENGTH(abcd)"}% returns 4
"$LIST(range)" Converts the content of a range of cells into a flat list, delimited by comma. Cells containing commas are merged into the list. Example: %CALC{"$LIST( $LEFT() )"}% returns Apples, Lemons, Oranges, Kiwis assuming the cells to the left contain | Apples | Lemons, Oranges | Kiwis |
Changed:
<
<
"$LISTIF(condition, list)" Remove elements from a list that do not meet a condition. In addition to the condition described in $IF(), you can use $item to indicate the current element. Examples:
%CALC{"$LISTIF($item > 12, 14, 7, 25)"}% returns 14, 25
%CALC{"$LISTIF($NOT($EXACT($item,)), A, B, , C)"}% returns A, B, C
>
>
"$LISTIF(condition, list)" Remove elements from a list that do not meet a condition. In addition to the condition described in $IF(), you can use $item to indicate the current element, and $index for the list index, starting at 1. Examples:
%CALC{"$LISTIF($item > 12, 14, 7, 25)"}% returns 14, 25
%CALC{"$LISTIF($NOT($EXACT($item,)), A, B, , E)"}% returns non-empty elements A, B, E
%CALC{"$LISTIF($index > 2, A, B, C, D)"}% returns C, D
 
"$LISTITEM(index, list)" Get one element of a list. Index is 1 to size of list; use a negative number to count from the end of the list. Examples:
%CALC{"$LISTITEM(2, Apple, Orange, Apple, Kiwi)"}% returns Orange
%CALC{"$LISTITEM(-1, Apple, Orange, Apple, Kiwi)"}% returns Kiwi
"$LISTMAP(formula, list)" Evaluate and update each element of a list. In the formula you can use $item to indicate the element; $index to show the index of the list, starting at 1. Example: %CALC{"$LISTMAP($index: $EVAL(2 * $item), 3, 5, 7, 11)"}% returns 1: 6, 2: 10, 3: 14, 4: 22
"$LISTREVERSE(list)" The opposite order of a list. Example: %CALC{"$LISTREVERSE(Apple, Orange, Apple, Kiwi)"}% returns Kiwi, Apple, Orange, Apple

Revision 8r8 - 03 Apr 2004 - 17:50:33 - PeterThoeny?
Revision 7r7 - 03 Apr 2004 - 08:23:23 - PeterThoeny?
This site is powered by the TWiki collaboration platform.
All material on this collaboration platform is the property of the contributing authors.
All material marked as authored by Eben Moglen is available under the license terms CC-BY-SA version 4.
Syndicate this site RSSATOM