Difference between revisions of "Multiple formats in one table"

(Created page with "Category:Analytica User Guide <languages /> <translate> Analytica User Guide > Usually, the same number format applies to all numbers in a table (except its index val...")
 
(Mention of cell-level format alternative in 5.0)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Analytica User Guide]]
 
[[Category:Analytica User Guide]]
<languages />
+
<breadcrumbs>Analytica User Guide > Number and table formats> {{PAGENAME}}</breadcrumbs>
<translate>
+
{{ReleaseBar}}
[[Analytica User Guide]] >
 
  
Usually, the same number format applies to all numbers in a table (except its index values in column or row headers, which use the format set for the index variable). Sometimes, you might want to use different formats for different rows (more generally, ''slices'') of a table. You can do this if you define the table as a list of variables, for example:
+
{{Release||4.6|Usually, the same [[Number formats|number format]] applies to all numbers in a table (except its index values in column or row headers, which use the format set for the index variable). Sometimes, you might want to use different formats for different rows (more generally, [[slice]]s) of a table. You can do this if you define the table as a list of variables, for example:}}
 +
{{Release|5.0||You can change the [[number format]] for a subset of cells in a table by selecting those cells and then bringing up the [[Number Format Dialog]]. This is intuitive, but it is often easier and preferable for your table to infer the number formats for each slice from the number formats of its parent variables. This happens if you define the result as a list of variables, for example:}}
  
'''Index Years := 2007..2012'''
+
:<code>Index Years := 2007..2012</code>
 +
:<code>Variable DollarX := Table(Years)(...) { Formatted as dollars }</code>
 +
:<code>Variable PercentX := DollarX/40K { Formatted as percent }</code>
 +
:<code>Variable MultiformatX := [DollarX, PercentX]</code>
 +
:<code>MultiformatX &rarr;</code>
  
'''Variable DollarX := Table(Years)(...) { Formatted as dollars } Variable PercentX := DollarX/40K { Formatted as percent } Variable MultiformatX := [DollarX, PercentX]'''
+
:[[File:Chapter7_8.png]]
  
'''MultiformatX ''' &rarr;
+
This table uses the number format set for each variable responsible for a row here — as long as you don’t override their settings by setting a format for <code>MultiformatX</code>.
  
[[File:Chapter7_8.png]]
+
==See Also==
 +
* [[Number formats]]
 +
* [[Creating Arrays (Tables)]]
 +
* [[Tutorial: Arrays]]
 +
* [[Table]]
 +
* [[Slice]]
 +
* [[Numbers and text]]
 +
* [[Datatype functions]]
 +
* [[Cell format dialog]]
 +
* [[MultiTable]]s
  
This table uses the number format set for each variable responsible for a row here — as long as you don’t override their settings by setting a format for '''MultiformatX'''.
 
  
==See Also==
+
<footer>Display of constraint results / {{PAGENAME}} / Graphs</footer>
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5
 
|- style="text-align: center"
 
| [[Display of constraint results]] <- || [[Multiple formats in one table]] || -> [[Graphing roles]]
 
|}
 
</translate>
 

Latest revision as of 00:44, 25 July 2017



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5



You can change the number format for a subset of cells in a table by selecting those cells and then bringing up the Number Format Dialog. This is intuitive, but it is often easier and preferable for your table to infer the number formats for each slice from the number formats of its parent variables. This happens if you define the result as a list of variables, for example:

Index Years := 2007..2012
Variable DollarX := Table(Years)(...) { Formatted as dollars }
Variable PercentX := DollarX/40K { Formatted as percent }
Variable MultiformatX := [DollarX, PercentX]
MultiformatX →
Chapter7 8.png

This table uses the number format set for each variable responsible for a row here — as long as you don’t override their settings by setting a format for MultiformatX.

See Also


Comments


You are not allowed to post comments.