TWiki home TWiki.Tukro > TWiki > SpreadSheetPlugin (r1.7 vs. r1.8) TWiki.Tukro webs:
Main | TWiki | Know | Sandbox
TWiki . { Welcome | Register | Changes | Topics | Index | Search | Go }
 <<O>>  Difference Topic SpreadSheetPlugin (r1.8 - 03 Apr 2004 - PeterThoeny)
Line: 1 to 1
Changed:
<
<
META TOPICINFO PeterThoeny date="1080980603" format="1.0" version="1.7"
>
>
META TOPICINFO PeterThoeny date="1081014633" format="1.0" version="1.8"

TWiki Spreadsheet Plugin

This Plugin adds speadsheet capabilities to TWiki.Tukro 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


Topic SpreadSheetPlugin . { View | Diffs | r1.8 | > | r1.7 | > | r1.6 | More }
Revision r1.7 - 03 Apr 2004 - 08:23 - PeterThoeny
Revision r1.8 - 03 Apr 2004 - 17:50 - PeterThoeny
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki.Tukro? Send feedback.