 <?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.analytica.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=J+bryan</id>
	<title>Analytica Docs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.analytica.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=J+bryan"/>
	<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php/Special:Contributions/J_bryan"/>
	<updated>2026-05-22T08:13:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://docs.analytica.com/index.php?title=RunConsoleProcess&amp;diff=20767</id>
		<title>RunConsoleProcess</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=RunConsoleProcess&amp;diff=20767"/>
		<updated>2011-11-08T19:55:25Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[What's new in Analytica 4.0?]] &amp;gt;&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
'''RunConsoleProcess''' lets an Analytica model run a ''console process'' -- that is, any Windows program. The program may be very simple with no graphical user interface that takes input from ''stdIn'' and writing output to ''stdOut'' -- or it may interact with the user directly. '''RunConsoleProcess''' gives the path and name of the application in the '''program''' parameter. It can feed input to the program via command line parameters in '''cmdLine''', or as input data given as text to the '''stdIn''' parameter, which is piped to the ''StdIn'' input channel of the console process. Normally, when the process completes, '''RunConsoleProcess''' will return a result (as text) any information the program writes to ''stdOut''. Analytica can also send data to a console process via a data files created with '''WriteTextFile''' or receive a data file created by the process using '''ReadTextFile'''.&lt;br /&gt;
&lt;br /&gt;
==Declaration ==&lt;br /&gt;
&lt;br /&gt;
 '''RunConsoleProcess'''(&lt;br /&gt;
   '''program''': Atomic Text,&lt;br /&gt;
   '''cmdLine''': Optional Atomic Text,&lt;br /&gt;
   '''stdIn''': Optional Atomic Text,&lt;br /&gt;
   '''block''': Optional Atomic Boolean, /* default TRUE */&lt;br /&gt;
   '''curDir''': Optional Atomic Text, /* default process directory */&lt;br /&gt;
   '''priority''': Optional Atomic Number, /* default 0 = normal, same as Ana */&lt;br /&gt;
   '''showErr''': Optional Numeric) /* defaults to 1=err msg */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''RunConsoleProcess''' offers considerable flexibility through a number of other optional parameters:&lt;br /&gt;
&lt;br /&gt;
'''block''': By default (or if you set '''block''' to True or 1),  '''RunConsoleProcess''' ''blocks'' -- that is, Analytica waits until the console process terminates and returns a result before it resumes execution. While blocked, Analytica still notices Windows events: If you press ''ctrl-break'' (or ''ctrl-.'') before the process terminates, it kills the process, and ends further computation by Analytica -- just like what it does when Analytica is computing without another process.&lt;br /&gt;
&lt;br /&gt;
If you pass False (0) to '''block''', '''RunConsoleProcess''' will not wait for the process to terminate: It immediately returns an empty text to Analytica. Analytica and the spawned process both continue running concurrently until they each terminate. If you press ''ctrl-.break'' (or ''ctrl-.''), it interrupts any computations by Analytica, but has no effect on the spawned process. An unblocked process is independent, and may continue running even after you exit Analytica. Unblocked processes are useful when you want to send data to another application for display, such as a special graphing package or GIS, or for saving selected results. It is hard to get any results or status back to Analytica from an unblocked process. It is usually best to use a blocked process if you need results back.&lt;br /&gt;
&lt;br /&gt;
The '''program''' and '''cmdLine''' parameters are separated, rather than lumped together as one parameter, to protect against a common type of virus attack. &lt;br /&gt;
&lt;br /&gt;
'''curDir''':  Any relative directory path specified in the program parameter is interpreted relative to Analytica's '''CurrentDataDirectory'''. '''curDir''' specifies the directory the spawned process should use as its default directory to read and write files. If '''curDir''' is not specified, it uses its own directory as its default . &lt;br /&gt;
&lt;br /&gt;
'''priority''' defines the priority that Windows should give the spawned process relative to the Analytica process. The default (0) runs the new process at the same priority as the Analytica program. A value of –1 or -2 lowers the priority, allowing other programs more of the CPU. A value of +1 or +2 raises the priority, dedicating more of the CPU to the process.&lt;br /&gt;
&lt;br /&gt;
'''showErr''': By default, in blocking mode, if the process writes anything to '''stdErr''', Analytica will display it as an error message when the process terminates. If ''showErr''=2 it shows any text in '''stdErr''' as a warning message. If ''showErr''=0, and always in non-blocking mode, it ignores anything in '''stdErr'''.&lt;br /&gt;
&lt;br /&gt;
'''Errors''': Analytica will give an error message if '''RunConsoleProcess''' cannot find or launch the specified program. &lt;br /&gt;
&lt;br /&gt;
'''RunConsoleProcess''' fully supports Intelligent Arrays: If any parameter is passed an array, it will run a separate process for each element of the array. It runs multiple blocking processes in sequence, one after another. It runs multiple non-blocking processes concurrently.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== VB Script ===&lt;br /&gt;
&lt;br /&gt;
Suppose the file '''HelloWorld.vbs''' is in your model directory and contains:&lt;br /&gt;
&lt;br /&gt;
 WScript.Echo &amp;quot;Hello World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Your call to RunConsoleProcess might look like:&lt;br /&gt;
&lt;br /&gt;
 RunConsoleProcess( &amp;quot;C:\Windows\System32\CScript.exe&amp;quot;,&lt;br /&gt;
                 &amp;quot;CScript /Nologo HelloWorld.vbs&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
The first parameter is the program (usually an EXE file) to be launched. You don't need to worry about quoting any spaces in the path name. The second parameter is the command line as it might appear on a command prompt. This expression will evaluate to the string &amp;quot;Hello World&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you need to send data to the '''StdIn''' of the process, include an optional parameter StdIn:&lt;br /&gt;
 RunConsoleProcess( &amp;quot;C:\Windows\System32\CScript.exe&amp;quot;,&lt;br /&gt;
                 &amp;quot;CScript /Nologo HelloWorld.vbs&amp;quot;,       &lt;br /&gt;
                 StdIn: MyDataToSend )&lt;br /&gt;
&lt;br /&gt;
where MyDataToSend evaluates to a text.&lt;br /&gt;
&lt;br /&gt;
=== Batch File ===&lt;br /&gt;
&lt;br /&gt;
In this example, a batch file named DoIt.bat is in the directory C:\Try.  Also in that directory is a file named &amp;quot;data.log&amp;quot;.  The batch file, DoIt.bat contains the following:&lt;br /&gt;
&lt;br /&gt;
 # DoIt.bat -- dump the log&lt;br /&gt;
 Type data.log&lt;br /&gt;
&lt;br /&gt;
This batch file assumes it is run from the directory C:\Try.  The call is:&lt;br /&gt;
&lt;br /&gt;
 RunConsoleProcess( &amp;quot;C:\Windows\System32\Cmd.exe&amp;quot;,&lt;br /&gt;
                    &amp;quot;Cmd /C DoIt.bat&amp;quot;,&lt;br /&gt;
                    CurDir: &amp;quot;C:\Try&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
or you can run it directly:&lt;br /&gt;
&lt;br /&gt;
 RunConsoleProcess( &amp;quot;DoIt.bat&amp;quot;, &amp;quot;DoIt.bat&amp;quot;, CurDir: &amp;quot;C:\Try&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
=== Reading Data from a URL ===&lt;br /&gt;
&lt;br /&gt;
To read the contents of a web page given its URL, you can use:&lt;br /&gt;
 RunConsoleProcess( &amp;quot;[[media:ReadURL.exe | ReadURL.exe]]&amp;quot;, &amp;quot;ReadURL &amp;quot; &amp;amp; url )&lt;br /&gt;
where url is a text string as would appear in the address bar of your browser.  You can download the [[media:ReadURL.exe | ReadURL.exe]] program by clicking on the link and saving.  The first parameter to RunConsoleProcess may need to be set to the full path where you placed [[media:ReadURL.exe | ReadURL.exe]] unless you put it in your [[CurrentDataDirectory]].&lt;br /&gt;
&lt;br /&gt;
A step-by-step example using [[media:ReadURL.exe | ReadURL.exe]] is given here: [[Retrieving Content From the Web]]. This example includes the source code for [[media:ReadURL.exe | ReadURL.exe]], and develops an example that obtains historical stock price data from the Yahoo finance web site.&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* Webinar: [http://analyticaonline.com/WebinarArchive/2007-10-18-Calling-External-Applications.wmv Calling-External-Applications.wmv] (requires Windows Media Player)&lt;br /&gt;
* [[CurrentDataDirectory]]&lt;br /&gt;
* [[WriteTextFile]], [[ReadTextFile]]&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Beta_Tester_Page&amp;diff=20664</id>
		<title>Beta Tester Page</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Beta_Tester_Page&amp;diff=20664"/>
		<updated>2011-10-31T21:29:53Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Beta 4.4 downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Analytica 4.4]] is now in beta testing.  As an Analytica user with active support, we invite you to become a beta tester.  Send bugs and feedback to [mailto:support@lumina.com support@lumina.com].  &lt;br /&gt;
&lt;br /&gt;
= Becoming a Beta Tester =&lt;br /&gt;
&lt;br /&gt;
* [[Beta Tester Page/Becoming a Beta Tester|Becoming a Beta Tester]], includes:&lt;br /&gt;
** How to become a beta tester&lt;br /&gt;
** Why become a beta tester&lt;br /&gt;
** Responsibilities of a beta tester&lt;br /&gt;
** Contributing to the Analytica Wiki&lt;br /&gt;
* [[Beta Tester Page/Submitting a Bug Report|Submitting a Bug Report]]&lt;br /&gt;
&lt;br /&gt;
= What's New in 4.4? =&lt;br /&gt;
&lt;br /&gt;
* Enhancements listed at [[What's new in Analytica 4.4?]]&lt;br /&gt;
* Changes from beta-build to beta-build are enumerated in [[Analytica 4.4 beta Release Notes|release notes]].&lt;br /&gt;
&lt;br /&gt;
= Beta 4.4 downloads =&lt;br /&gt;
&lt;br /&gt;
The current release is 4.4.0.13.  The latest beta-build installers can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
* [http://AnalyticaOnline.com/ANA4.4/AnaSetup4_4_0_13.exe Analytica 32-bit]&lt;br /&gt;
* [http://AnalyticaOnline.com/ANA4.4/Ana64Setup4_4_0_13.exe Analytica 64-bit]&lt;br /&gt;
* [http://AnalyticaOnline.com/ANA4.4/AdeSetup4_4_0_13.exe ADE 32-bit]&lt;br /&gt;
* [http://AnalyticaOnline.com/ANA4.4/Ade64Setup4_4_0_13.exe ADE 64-bit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The installers can be downloaded directly from the [http://www.lumina.com/support/downloads/ Lumina Downloads] page.  --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Beta Testing Licenses =&lt;br /&gt;
&lt;br /&gt;
To get the beta software you need a beta-tester license.  As a beta tester, you will normally have: &lt;br /&gt;
* An individual license for Analytica 4.2 or 4.3 already installed on your computer&lt;br /&gt;
* Active support&lt;br /&gt;
* An internet connection&lt;br /&gt;
In that case, the installer should automatically obtain the necessary beta license and you need to do nothing more (a feature that itself is being beta-tested). &lt;br /&gt;
&lt;br /&gt;
If you are set up with a centrally-managed license for Analytica 4.2 or 4.3 (e.g., a floating license), the installer should still be able to obtain a beta license for you automatically, assuming you have active support and an internet connection.&lt;br /&gt;
&lt;br /&gt;
If you use a floating license with active support and want to install a 4.4 beta license on the RLM server for easy use by anyone in your organization, please contact us via support@lumina.com.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Beta licenses are not currently available since we are not in an active beta testing cycle at this time.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Analytica 4.4 beta Release Notes| Release Notes]] ==&lt;br /&gt;
&lt;br /&gt;
See [[Analytica 4.4 beta Release Notes| release notes]] for what's changed in each beta release. It lists new features and fixes to significant problems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known issues ==&lt;br /&gt;
&lt;br /&gt;
* See the [[Pending Analytica 4.4 Issues]] page for known issues in the current beta build.&lt;br /&gt;
* See [[Analytica 4.4 beta Release Notes]] for issues that present in early beta bulids, but since fixed.&lt;br /&gt;
&lt;br /&gt;
= FAQs: Frequently Asked Questions =&lt;br /&gt;
&lt;br /&gt;
See [[Analytica User FAQs]] for frequently asked questions not specific to 4.4 or to beta.&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
== User Group and Special 4.4 Webinars ==&lt;br /&gt;
&lt;br /&gt;
Check the [[Analytica User Group]] page for information on webinars covering new 4.4 features and other topic of general interest to the Analytica community.  &lt;br /&gt;
&lt;br /&gt;
Consider being a presenter at a webinar yourself!&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Analytica_4.4_beta_Release_Notes/Changes_in_4.4.0.12&amp;diff=20559</id>
		<title>Analytica 4.4 beta Release Notes/Changes in 4.4.0.12</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Analytica_4.4_beta_Release_Notes/Changes_in_4.4.0.12&amp;diff=20559"/>
		<updated>2011-10-13T21:45:24Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Preferences */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Analytica 4.4 beta Release Notes|&amp;lt;&amp;lt; Analytica 4.4 beta Release Notes]]&lt;br /&gt;
&lt;br /&gt;
This page lists fixes in beta build 4.4.0.12 since the previous [[Analytica 4.4 beta Release Notes/Changes in 4.4.0.9|beta build 4.4.0.9]].  For major enhancements since 4.3, see [[What's new in Analytica 4.4?]].&lt;br /&gt;
&lt;br /&gt;
= Clipboard (Copy/Paste) =&lt;br /&gt;
&lt;br /&gt;
* Removed PNG type with transparent background from clipboard (experiment in built 4.4.0.9).  Windows GDI+ does not handle transparent backgrounds well, many things didn't look good, so we include the background color always.  &lt;br /&gt;
&lt;br /&gt;
* Fixed a case where garbage cell data sometimes pasted from Excel.&lt;br /&gt;
&lt;br /&gt;
* Fixed a problem where node colors were altered when they were pasted.&lt;br /&gt;
&lt;br /&gt;
* copy/pasting of several esoteric data types from one variable to an edit table in the same Analytica works better.  Things like handles, references, LP/QP terms, pictures, comparison terms.&lt;br /&gt;
&lt;br /&gt;
* Improved awareness of when quotes should be omitted or included when pasting textual values between Analytica views.&lt;br /&gt;
&lt;br /&gt;
* Copy diagram image (or node images) would not capture the image with identifiers when the '''Show by identifiers''' was set.&lt;br /&gt;
&lt;br /&gt;
= Diagrams =&lt;br /&gt;
&lt;br /&gt;
* Fixed cases where balloons would persist despite having left the window.&lt;br /&gt;
&lt;br /&gt;
* Dragging of nodes interrupted by balloon hover.&lt;br /&gt;
&lt;br /&gt;
* Removed the anachronism &amp;quot;Set Diagram Size&amp;quot; from the right-mouse context menu.&lt;br /&gt;
&lt;br /&gt;
* Restored cross hatching of input or alias nodes when the original is cut but still on clipboard.&lt;br /&gt;
&lt;br /&gt;
* The initial diagram window for a new model started a bit too far left, so that the left boundary was outside the desk window.&lt;br /&gt;
&lt;br /&gt;
= Engine =&lt;br /&gt;
&lt;br /&gt;
* Fixed a potential memory leak that could occur when a stack overflow condition occurs.&lt;br /&gt;
&lt;br /&gt;
* Improved robustness of stack overflow handling, including fixing cases that could cause crashes.&lt;br /&gt;
&lt;br /&gt;
* The [[Iterate]] function now accepts named parameters.&lt;br /&gt;
&lt;br /&gt;
= Example Models =&lt;br /&gt;
&lt;br /&gt;
* Updated example models that still had the anachronistic PICT format (from the old Mac days) to use modern PNG image formats.  PICT is the one format that ACP does not support, so this allows these models to display their images when uploaded to ACP.&lt;br /&gt;
&lt;br /&gt;
* The Newton Raphson example model was updated to use the [[Iterate]] function, rather than the [[Dynamic]] function.&lt;br /&gt;
&lt;br /&gt;
= Excel Spreadsheet Functions =&lt;br /&gt;
&lt;br /&gt;
Unfortunately, Excel 2010 has introduced numerous bugs into its COM API support, which impact the Analytica Spreadsheet functions.  This build contains numerous enhancements to work around these Excel bugs to make the spreadsheet functions more robust.&lt;br /&gt;
&lt;br /&gt;
* When saving a workbook via [[SpreadsheetSave]], Excel 2010 would set its visibility flag to hidden.  Then, when you loaded it into Excel, it would appear you were staring at a blank spreadsheet (but it would open fine in Open Office, and other Spreadsheet functions would read the data as if it were there).  From Excel, you would need to go to the '''View''' Tab and select '''Unhide''' to see anything.  [[SpreadsheetSave]] now momentarily sets the visibility flag to unhidden before saving.&lt;br /&gt;
&lt;br /&gt;
* Another Excel 2010 but is that when the visibility flag is toggled, a background EXCEL.EXE process fails to terminate when all references to a workbook are released.  This would cause the Excel.exe process to linger on Task manager even after you closed your Analytica model.  As a work around, when Analytica releases a workbook, it checks whether the spreadsheet is being viewed from an Excel graphical user interface.  If not, it closes it, which then allows the Excel.exe process to terminate as it should.&lt;br /&gt;
&lt;br /&gt;
* If a workbook instance is exogenously terminated after [[SpreadsheetOpen]] has established a connection to it, errors (like [[Error Messages/42645|The object invoked has disconnected from its clients]] or [[Error Messages/42645|The RPC server is unavailable]]) would occur the next time you tried to evaluate a spreadsheet function on the workbook.  Exogenous termination could be the result of a bug in Excel 2010 that terminates the workbook when it is closed by the user from the graphical user interface even when an external application holds a reference to it, or when the Excel.exe background process is killed from task manager.  Now it can also occur as a result of the previous bullet if two different Analytica processes are simultaneously using the same Excel workbook.  Now, when this connection is broken, when you attempt to evaluate a spreadsheet function it will attempt to re-establish a connection, which usually means launching an instance of Excel again in the background.&lt;br /&gt;
&lt;br /&gt;
= Expression Assist =&lt;br /&gt;
&lt;br /&gt;
* Autocomplete would linger, often after backspacing over the first character of an identifier, and act as if first character of the identifier still existed.&lt;br /&gt;
&lt;br /&gt;
* Parameter help for [[Iterate]]&lt;br /&gt;
&lt;br /&gt;
* Parameter help for [[Var..Do]] and related declarations improved.&lt;br /&gt;
&lt;br /&gt;
= File Saving/Loading =&lt;br /&gt;
&lt;br /&gt;
* When a legacy (4.3 or earlier) model is loaded into 4.4, the &amp;quot;do not use ClearType fonts&amp;quot; flag should become set.  This causes the same fonts to be used for node titles as in 4.3, so that work breaks occur at the same places.  In one model submitted, this flag did not get set as it should have, so we fixed this case.  We do recommend that you switch over to ClearType fonts ('''Diagram&amp;amp;rarr;Set Diagram Style...''' from the top-level model diagram) -- it looks better and several improved functionalities are only available when ClearType fonts are on -- but you will likely need to adjust some nodes due to altered work wrapping.&lt;br /&gt;
&lt;br /&gt;
* The images of diagrams produced by '''File&amp;amp;rarr;Export...''' were often quite ugly, with splotchy fonts and lines.  These now look much better.&lt;br /&gt;
&lt;br /&gt;
* When an identifier collision occurs with a UDF when adding a module, and one UDF is renamed, it would lose its parameters attribute.&lt;br /&gt;
&lt;br /&gt;
= Object Window =&lt;br /&gt;
&lt;br /&gt;
* When editing a definition (or any other text field) before any other change has been made since the model was last saved, the Save option would be disabled, even though you've made edits in the field being edited. &lt;br /&gt;
&lt;br /&gt;
= Preferences =&lt;br /&gt;
&lt;br /&gt;
* The '''Use Excel date origin''' preference was using the wrong date offset in the previous 4.4 beta builds. Note: When loading a model from a previous build with '''Use Excel date origin''' set, you must un-check and re-check the preference box for the changes to take hold.&lt;br /&gt;
&lt;br /&gt;
= Printing =&lt;br /&gt;
&lt;br /&gt;
* Stray buttons and stray rectangles were visible on an Object Window's Print Preview.&lt;br /&gt;
&lt;br /&gt;
* Several problems fixed with printout when a scaling percentage was used.&lt;br /&gt;
&lt;br /&gt;
* Fixed an intermittent crash when previewing an Object Window.&lt;br /&gt;
&lt;br /&gt;
= Typescript =&lt;br /&gt;
&lt;br /&gt;
* The time required to print stuff to the typescript window is dramatically faster.&lt;br /&gt;
&lt;br /&gt;
= Windows Management =&lt;br /&gt;
&lt;br /&gt;
* Minimizing of windows was not functioning in 4.4.0.9&lt;br /&gt;
&lt;br /&gt;
= ADE =&lt;br /&gt;
&lt;br /&gt;
* The ADE installer now adds a folder to the Start Menu with shortcuts to the manuals, to AdeTest, and to the register component (i.e., &amp;lt;code&amp;gt;ADE.EXE /RegServer&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
* The AdeTest application is now configured to compile a 32-bit executable or 64-bit executable, and the 32-bit or 64-bit AdeTest.exe is included with the corresponding installer.  This allows the '''New ADEW.CAEngine''' button to work when you install 32-bit ADE on a 64-bit Windows platform.&lt;br /&gt;
&lt;br /&gt;
* CAObject::ResultTable with CAObject::ResultType=3 (PDF) picks up KDE Smoothness settings when the variable is set to use [[Kernel Density Smoothing]].&lt;br /&gt;
&lt;br /&gt;
* When running ADE on web servers, some security issues may arise.  For example, should the use of [[RunConsoleProcess]] be allowed at all?  If anonymous end-users are uploading their own models, then maybe you'll want to disable this.  Perhaps you'd like to make it impossible to call DbWrite from a variable that contains an input node, so as to prevent a malicious SQL-injection attack.  Security can be configured on a function-by-function basis by modifying the Analytica.ini file.  Comments present in that file provide the details.&lt;br /&gt;
&lt;br /&gt;
* Uninstall of Analytica 32-bit removed the TypeLib registry settings for Analytica 64-bit.&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Analytica_4.4_beta_Release_Notes/Changes_in_4.4.0.12&amp;diff=20558</id>
		<title>Analytica 4.4 beta Release Notes/Changes in 4.4.0.12</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Analytica_4.4_beta_Release_Notes/Changes_in_4.4.0.12&amp;diff=20558"/>
		<updated>2011-10-13T21:44:52Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Preferences */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Analytica 4.4 beta Release Notes|&amp;lt;&amp;lt; Analytica 4.4 beta Release Notes]]&lt;br /&gt;
&lt;br /&gt;
This page lists fixes in beta build 4.4.0.12 since the previous [[Analytica 4.4 beta Release Notes/Changes in 4.4.0.9|beta build 4.4.0.9]].  For major enhancements since 4.3, see [[What's new in Analytica 4.4?]].&lt;br /&gt;
&lt;br /&gt;
= Clipboard (Copy/Paste) =&lt;br /&gt;
&lt;br /&gt;
* Removed PNG type with transparent background from clipboard (experiment in built 4.4.0.9).  Windows GDI+ does not handle transparent backgrounds well, many things didn't look good, so we include the background color always.  &lt;br /&gt;
&lt;br /&gt;
* Fixed a case where garbage cell data sometimes pasted from Excel.&lt;br /&gt;
&lt;br /&gt;
* Fixed a problem where node colors were altered when they were pasted.&lt;br /&gt;
&lt;br /&gt;
* copy/pasting of several esoteric data types from one variable to an edit table in the same Analytica works better.  Things like handles, references, LP/QP terms, pictures, comparison terms.&lt;br /&gt;
&lt;br /&gt;
* Improved awareness of when quotes should be omitted or included when pasting textual values between Analytica views.&lt;br /&gt;
&lt;br /&gt;
* Copy diagram image (or node images) would not capture the image with identifiers when the '''Show by identifiers''' was set.&lt;br /&gt;
&lt;br /&gt;
= Diagrams =&lt;br /&gt;
&lt;br /&gt;
* Fixed cases where balloons would persist despite having left the window.&lt;br /&gt;
&lt;br /&gt;
* Dragging of nodes interrupted by balloon hover.&lt;br /&gt;
&lt;br /&gt;
* Removed the anachronism &amp;quot;Set Diagram Size&amp;quot; from the right-mouse context menu.&lt;br /&gt;
&lt;br /&gt;
* Restored cross hatching of input or alias nodes when the original is cut but still on clipboard.&lt;br /&gt;
&lt;br /&gt;
* The initial diagram window for a new model started a bit too far left, so that the left boundary was outside the desk window.&lt;br /&gt;
&lt;br /&gt;
= Engine =&lt;br /&gt;
&lt;br /&gt;
* Fixed a potential memory leak that could occur when a stack overflow condition occurs.&lt;br /&gt;
&lt;br /&gt;
* Improved robustness of stack overflow handling, including fixing cases that could cause crashes.&lt;br /&gt;
&lt;br /&gt;
* The [[Iterate]] function now accepts named parameters.&lt;br /&gt;
&lt;br /&gt;
= Example Models =&lt;br /&gt;
&lt;br /&gt;
* Updated example models that still had the anachronistic PICT format (from the old Mac days) to use modern PNG image formats.  PICT is the one format that ACP does not support, so this allows these models to display their images when uploaded to ACP.&lt;br /&gt;
&lt;br /&gt;
* The Newton Raphson example model was updated to use the [[Iterate]] function, rather than the [[Dynamic]] function.&lt;br /&gt;
&lt;br /&gt;
= Excel Spreadsheet Functions =&lt;br /&gt;
&lt;br /&gt;
Unfortunately, Excel 2010 has introduced numerous bugs into its COM API support, which impact the Analytica Spreadsheet functions.  This build contains numerous enhancements to work around these Excel bugs to make the spreadsheet functions more robust.&lt;br /&gt;
&lt;br /&gt;
* When saving a workbook via [[SpreadsheetSave]], Excel 2010 would set its visibility flag to hidden.  Then, when you loaded it into Excel, it would appear you were staring at a blank spreadsheet (but it would open fine in Open Office, and other Spreadsheet functions would read the data as if it were there).  From Excel, you would need to go to the '''View''' Tab and select '''Unhide''' to see anything.  [[SpreadsheetSave]] now momentarily sets the visibility flag to unhidden before saving.&lt;br /&gt;
&lt;br /&gt;
* Another Excel 2010 but is that when the visibility flag is toggled, a background EXCEL.EXE process fails to terminate when all references to a workbook are released.  This would cause the Excel.exe process to linger on Task manager even after you closed your Analytica model.  As a work around, when Analytica releases a workbook, it checks whether the spreadsheet is being viewed from an Excel graphical user interface.  If not, it closes it, which then allows the Excel.exe process to terminate as it should.&lt;br /&gt;
&lt;br /&gt;
* If a workbook instance is exogenously terminated after [[SpreadsheetOpen]] has established a connection to it, errors (like [[Error Messages/42645|The object invoked has disconnected from its clients]] or [[Error Messages/42645|The RPC server is unavailable]]) would occur the next time you tried to evaluate a spreadsheet function on the workbook.  Exogenous termination could be the result of a bug in Excel 2010 that terminates the workbook when it is closed by the user from the graphical user interface even when an external application holds a reference to it, or when the Excel.exe background process is killed from task manager.  Now it can also occur as a result of the previous bullet if two different Analytica processes are simultaneously using the same Excel workbook.  Now, when this connection is broken, when you attempt to evaluate a spreadsheet function it will attempt to re-establish a connection, which usually means launching an instance of Excel again in the background.&lt;br /&gt;
&lt;br /&gt;
= Expression Assist =&lt;br /&gt;
&lt;br /&gt;
* Autocomplete would linger, often after backspacing over the first character of an identifier, and act as if first character of the identifier still existed.&lt;br /&gt;
&lt;br /&gt;
* Parameter help for [[Iterate]]&lt;br /&gt;
&lt;br /&gt;
* Parameter help for [[Var..Do]] and related declarations improved.&lt;br /&gt;
&lt;br /&gt;
= File Saving/Loading =&lt;br /&gt;
&lt;br /&gt;
* When a legacy (4.3 or earlier) model is loaded into 4.4, the &amp;quot;do not use ClearType fonts&amp;quot; flag should become set.  This causes the same fonts to be used for node titles as in 4.3, so that work breaks occur at the same places.  In one model submitted, this flag did not get set as it should have, so we fixed this case.  We do recommend that you switch over to ClearType fonts ('''Diagram&amp;amp;rarr;Set Diagram Style...''' from the top-level model diagram) -- it looks better and several improved functionalities are only available when ClearType fonts are on -- but you will likely need to adjust some nodes due to altered work wrapping.&lt;br /&gt;
&lt;br /&gt;
* The images of diagrams produced by '''File&amp;amp;rarr;Export...''' were often quite ugly, with splotchy fonts and lines.  These now look much better.&lt;br /&gt;
&lt;br /&gt;
* When an identifier collision occurs with a UDF when adding a module, and one UDF is renamed, it would lose its parameters attribute.&lt;br /&gt;
&lt;br /&gt;
= Object Window =&lt;br /&gt;
&lt;br /&gt;
* When editing a definition (or any other text field) before any other change has been made since the model was last saved, the Save option would be disabled, even though you've made edits in the field being edited. &lt;br /&gt;
&lt;br /&gt;
= Preferences =&lt;br /&gt;
&lt;br /&gt;
* The '''Use Excel date origin''' preference was using the wrong date offset in the previous 4.4 beta builds.&lt;br /&gt;
When loading a model from a previous build with '''Use Excel date origin''' set, you must un-check and re-check the preference box for the changes to take hold.&lt;br /&gt;
&lt;br /&gt;
= Printing =&lt;br /&gt;
&lt;br /&gt;
* Stray buttons and stray rectangles were visible on an Object Window's Print Preview.&lt;br /&gt;
&lt;br /&gt;
* Several problems fixed with printout when a scaling percentage was used.&lt;br /&gt;
&lt;br /&gt;
* Fixed an intermittent crash when previewing an Object Window.&lt;br /&gt;
&lt;br /&gt;
= Typescript =&lt;br /&gt;
&lt;br /&gt;
* The time required to print stuff to the typescript window is dramatically faster.&lt;br /&gt;
&lt;br /&gt;
= Windows Management =&lt;br /&gt;
&lt;br /&gt;
* Minimizing of windows was not functioning in 4.4.0.9&lt;br /&gt;
&lt;br /&gt;
= ADE =&lt;br /&gt;
&lt;br /&gt;
* The ADE installer now adds a folder to the Start Menu with shortcuts to the manuals, to AdeTest, and to the register component (i.e., &amp;lt;code&amp;gt;ADE.EXE /RegServer&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
* The AdeTest application is now configured to compile a 32-bit executable or 64-bit executable, and the 32-bit or 64-bit AdeTest.exe is included with the corresponding installer.  This allows the '''New ADEW.CAEngine''' button to work when you install 32-bit ADE on a 64-bit Windows platform.&lt;br /&gt;
&lt;br /&gt;
* CAObject::ResultTable with CAObject::ResultType=3 (PDF) picks up KDE Smoothness settings when the variable is set to use [[Kernel Density Smoothing]].&lt;br /&gt;
&lt;br /&gt;
* When running ADE on web servers, some security issues may arise.  For example, should the use of [[RunConsoleProcess]] be allowed at all?  If anonymous end-users are uploading their own models, then maybe you'll want to disable this.  Perhaps you'd like to make it impossible to call DbWrite from a variable that contains an input node, so as to prevent a malicious SQL-injection attack.  Security can be configured on a function-by-function basis by modifying the Analytica.ini file.  Comments present in that file provide the details.&lt;br /&gt;
&lt;br /&gt;
* Uninstall of Analytica 32-bit removed the TypeLib registry settings for Analytica 64-bit.&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=DbQuery&amp;diff=20545</id>
		<title>DbQuery</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=DbQuery&amp;diff=20545"/>
		<updated>2011-10-05T02:07:54Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* ODBC to read Excel data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Database Functions]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''(Requires Analyica Enterprise or Power Player)''&lt;br /&gt;
&lt;br /&gt;
= DbQuery( connectionString, sql'', key, datesAsText'' ) =&lt;br /&gt;
&lt;br /&gt;
Used to define an index Variable. The definition of the index should contain only one DbQuery() statement. «ConnectionString» specifies a data source (e.g., 'DSN=MyDatabase'). The «sql» parameter defines an SQL query.&lt;br /&gt;
&lt;br /&gt;
When placed as the definition of an index Variable, [[DbQuery]]() will be evaluated as soon as the definition is complete. When it is evaluated, the actual query is performed. The resulting result table is cached in the ''Att_recordSet'' attribute of the variable (or local index) containing the call to [[DbQuery]], which is then subsequently accessed by [[DbTable]]() or [[DbLabels]]().&lt;br /&gt;
&lt;br /&gt;
[[DbQuery]]() returns a sequence 1..n, where n is the number of records (rows) in the result table.  ([[What's new in Analytica 4.2?|''new to 4.2'']]): Alternatively, you can use one column from the result set as the index labels by specifying the name of the column in the optional «key» parameter.&lt;br /&gt;
&lt;br /&gt;
[[DbQuery]]() should appear only once in a definition, and if it is embedded in an expression, the expression must return a list with n elements.&lt;br /&gt;
&lt;br /&gt;
[[DbQuery]]() processes the sql statement in read-only mode, so that the data source cannot be altered as a result of executing this statement. To alter the data source, use [[DbWrite]]().&lt;br /&gt;
&lt;br /&gt;
== New to 4.0 ==&lt;br /&gt;
&lt;br /&gt;
In Analytica 4.0 (but not earlier releases), a local index can hold the record set.  This means you can create a user-defined function that bundles several database query steps.  For example:&lt;br /&gt;
&lt;br /&gt;
  Function DbFullTable(connectionStr, sql: text)&lt;br /&gt;
  Definition:&lt;br /&gt;
     [[Index]] Rows := [[DbQuery]](connectionStr, sql);&lt;br /&gt;
     [[Index]] Cols := [[DbLabels]](Rows);&lt;br /&gt;
     [[DbTable]](Rows, Cols)&lt;br /&gt;
&lt;br /&gt;
This user-defined function returns the full relational table in a single call, using local indexes, Rows and Cols.&lt;br /&gt;
&lt;br /&gt;
== Date and Time data ==&lt;br /&gt;
&lt;br /&gt;
''New to [[What's new in Analytica 4.2?|Analytica 4.2.3]]''&lt;br /&gt;
&lt;br /&gt;
Date and time values retreived from the database are returned as text.  Beginning with release 4.2.3, you can also opt to have date or time data types returned as date-time numbers.  A date-time number in Analytica encodes a point in time as the number of days elapsed since the date origin (usually Jan 1, 1904).  Date-time numbers respond to the Date style Number Format.&lt;br /&gt;
&lt;br /&gt;
The system variable, ''Sys_DbDatesAsText'' contains a global preference for the handling of dates by [[DbQuery]] or [[DbWrite]].  When this system variable is 0 (false), dates are returned as text.  When set to 1, dates are returned as date-time numbers.  For backward compatibility with pre-4.2.3 releases, it is 0 by default.&lt;br /&gt;
&lt;br /&gt;
Individual calls to [[DbQuery]] can override the system default by specifying the optional «datesAsText» parameter.&lt;br /&gt;
&lt;br /&gt;
= Connection String Syntax =&lt;br /&gt;
&lt;br /&gt;
Comprehensive references for connection string syntax across different database services are at [http://www.connectionstrings.com www.connectionStrings.com].&lt;br /&gt;
&lt;br /&gt;
== Using a configured DSN ==&lt;br /&gt;
&lt;br /&gt;
The ''connectionString'' parameter specifies the data source that you will be querying.  The most common syntax for the connection string is:&lt;br /&gt;
:&amp;quot;DSN=«name»&amp;quot;&lt;br /&gt;
where ''«name»'' is the name of a system or user data source that you have previously configured in the '''Data Sources (ODBC)''' wizard (accessable in Windows via &lt;br /&gt;
:Start &amp;amp;rarr; Programs &amp;amp;rarr; Administrative Tools &amp;amp;rarr; Data Sources (ODBC).&lt;br /&gt;
&lt;br /&gt;
You can augment a DSN-based connection string with additional keyword values.  These are specific to the database driver you are using, and the names of these additional keywords must be found from other documentation.  For example, some databases require a login and password, which can be added to the connection string as:&lt;br /&gt;
:&amp;quot;DSN=MyDatabase; UID=John; PWD=Lightning&amp;quot;&lt;br /&gt;
Some databases require two logins, one for the server, and another for the DBMS.  In this case, both can be specified:&lt;br /&gt;
:&amp;quot;DSN=MyDatabase; UID=John; PWD=Lightning; UIDDBMS=JQR; PWDDBMS=Thunder&amp;quot;&lt;br /&gt;
&lt;br /&gt;
There are a couple of advantages to using a DSN to specify your data source.  First, the wizard in Windows makes it relatively easy to select the appropriate driver and configure the parameters used to access the data source.  Second, the ''connectionString'' parameter in your model remains very simple.  And third, the model is not reliant on the precise location of the database, so that if someone else uses your model on a different machine, the connection string can remain valid.  On the downside, it does mean that whenever you share your model with someone else, they must configure a DSN before using it.&lt;br /&gt;
&lt;br /&gt;
== Directly accessing the database file ==&lt;br /&gt;
&lt;br /&gt;
You can also access your database directly, without configuring a DSN.  To do this, at a minimum you need to specify the ODBC driver name and the database location in the connection string.&lt;br /&gt;
&lt;br /&gt;
The driver name can be discovered by evaluating &lt;br /&gt;
:[[SqlDriverInfo]](&amp;quot;&amp;quot;)&lt;br /&gt;
from within Analytica.  &lt;br /&gt;
&lt;br /&gt;
Many drivers use the keyword DBQ for specifying the file path to the database.  Some database drivers (examples are Microsoft Access and Excel) store the database in a single file, so the path specifies the actual file.  Other drivers (e.g., Paradox, Text driver) store their database in many files in a single directory, in which case DBQ locates the directory.  Here are some example of connection strings:&lt;br /&gt;
:&amp;quot;Driver=Microsoft Access Driver (*.mdb); DBQ=C:\MyData\MyDatabase.mdb&amp;quot;&lt;br /&gt;
:&amp;quot;Driver=Microsoft Excel Driver (*.xls); DBQ=&amp;quot; &amp;amp; [[CurrentModelDirectory]]() &amp;amp; &amp;quot;\SourceData.xls&amp;quot;&lt;br /&gt;
:&amp;quot;Driver=Microsoft Paradox Driver (*.db); DBQ=C:\MyData\MyDatabaseDirectory&amp;quot;&lt;br /&gt;
:&amp;quot;Driver=Microsoft Text Driver (*.txt; *.csv); DBQ=&amp;quot;C:\MyData\MyCsvTables&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that when specifying the location, you must use absolute path names.  The ODBC drivers do not know anything about Analytica's current directories.  You may find [[CurrentModelDirectory]] and [[CurrentDataDirectory]] functions useful for computing full path names when your data source is in the same directory as your model, or a subdirectory.&lt;br /&gt;
&lt;br /&gt;
= SQL Syntax =&lt;br /&gt;
&lt;br /&gt;
Databases contain tables, each table having a name.  The simplest and most common SQL statement is one that retrieve all the data from a given table:&lt;br /&gt;
:&amp;quot;SELECT * FROM ''tableName''&amp;quot;&lt;br /&gt;
Many databases also allow you to define queries, which may join several underlying tables to create a new computed table results.  The names of such predefined queries can usually be used in place of ''tableName'' as well.&lt;br /&gt;
&lt;br /&gt;
The SELECT statement is SQL's workhorse for reading data.  You can expand on this simple form by selecting only a subset of the columns, selecting only a subset of the rows using a ''search condition'', joining multiple tables, sorting the selected rows, eliminating duplicate rows, or grouping (aggregating) the rows.  The following shows the general syntax used by most SQL databases, where brackets surround optional parts:&lt;br /&gt;
 SELECT column_list&lt;br /&gt;
 [ FROM list_of_tables ]&lt;br /&gt;
 [ WHERE search_condition ]&lt;br /&gt;
 [ ORDER BY column_list [ASC|DESC] ]&lt;br /&gt;
 [ GROUP BY group_by_expression ]&lt;br /&gt;
 [ HAVING group_search_conditon ]&lt;br /&gt;
&lt;br /&gt;
If you are creating a complex query, involving the joining of multiple tables and complex WHERE or GROUP BY criteria, a convenient way to do this by using an SQL designer application.  Graphical user interfaces that help you create your SQL queries can be found in Microsoft Access, in a program called Microsoft Query, in Microsoft SQL Server management studio, etc.&lt;br /&gt;
&lt;br /&gt;
You can often bring entire tables into Analytica and &amp;quot;join&amp;quot; them from within Analytica, using Analytica expressions.  However, if you are dealing with huge databases, then use of more sophisticated SQL can be used to reduce the amount of data that needs to be transferred and held in Analytica's memory.&lt;br /&gt;
&lt;br /&gt;
Note that DbQuery cannot be used to modify the database -- it executes its SQL in a read-only model.  Other SQL statements can be used to modify a database -- creating new tables, adding or removing data to/from tables, etc.  To utilize these SQL statements, you must use [[DbWrite]].&lt;br /&gt;
&lt;br /&gt;
== ODBC to read Excel data ==&lt;br /&gt;
&lt;br /&gt;
ODBC can be used to read data from Excel spreadsheets, at least in a rudimentary way.  However, if you want to read from Excel spreadsheets, we recommend using the [[Functions To Read Excel Worksheets|Spreadsheet Access functions]] instead, which are similar in result, but can also be used from Analytica 64-bit (The JET database drivers, required for ODBC queries into Excel, are only available for use by 32-bit processs). Nevertheless, understanding how to access spreadsheets through ODBC can be informative, so a description is provided here.&lt;br /&gt;
&lt;br /&gt;
When using ODBC from Excel, data that you might read should be organized as a table, where the first row of the table contains column labels.  If you have a single table on a worksheet, you can use:&lt;br /&gt;
: &amp;quot;Select * from [Sheet1$]&amp;quot;.&lt;br /&gt;
The Excel ODBC driver wants the the name of the sheet to be followed by a dollar sign, and because of this, you must surround the sheet name and dollar sign with square brackets.&lt;br /&gt;
&lt;br /&gt;
If you name a region in your workbook, you can read the contents of that region using:&lt;br /&gt;
: &amp;quot;Select * from [RegionName]&amp;quot;&lt;br /&gt;
In this case, you don't have to specify a worksheet name, and you don't include the trailing dollar sign.  The first row of your region needs to have column labels.  If the first row does not have column labels, it will omit the first row from the result and return placeholder labels like [&amp;quot;F1&amp;quot;,&amp;quot;F2&amp;quot;,&amp;quot;F3&amp;quot;].  &lt;br /&gt;
&lt;br /&gt;
You can query a cell range using, e.g.:&lt;br /&gt;
: &amp;quot;Select * from [Sheet1$D17:F55]&amp;quot;&lt;br /&gt;
Again, the first row (in this example, D17:F17), of the range needs to have labels.  I do not know of a way of reading a transposed table (i.e., where the labels are row headers, and the fields for each record are in the same column).  If the block of data don't have the labels for the first row, as long as it doesn't start in row 1, you can always start your query from one row previous.  E.g., if you want cells F9:H12, then query F8:H12.&lt;br /&gt;
&lt;br /&gt;
One downside with using ODBC to query an Excel workbook is that the ODBC driver does not seem to pick up on changes made from Excel itself while Analytica and Excel are both open.  If you change something in Excel, you may need to exit Analytica, then save the Excel file with the change, then re-enter Analytica.  It appears that the Excel ODBC driver locks the file in certain ways and caches certain things so that changes are not always picked up once the driver has been loaded.  When you load the file into Excel once the workbook has already been queried, it seems to convert to a read-only mode a soon as you attempt to save.  &lt;br /&gt;
&lt;br /&gt;
On the upside, there are advantages to using ODBC for reading data from Excel over OLE linking.  Especially if you use a one table per sheet organization, then the size of the table adapts very gracefully with ODBC when the amount of data in Excel changes.&lt;br /&gt;
&lt;br /&gt;
= Programs with ODBC support =&lt;br /&gt;
&lt;br /&gt;
ODBC drivers exist for the following programs (this is only a partial list), which means if you need to exchange data between these applications and Analytica, the use of ODBC may be an option.  &lt;br /&gt;
&lt;br /&gt;
* SQL Server&lt;br /&gt;
* Microsoft Access&lt;br /&gt;
* Oracle&lt;br /&gt;
* MySQL&lt;br /&gt;
* IBM DB2&lt;br /&gt;
* Sybase&lt;br /&gt;
* Paradox&lt;br /&gt;
* Microsoft Excel&lt;br /&gt;
* Text files -- csv, fixed-width delimited, others.&lt;br /&gt;
* FoxPro&lt;br /&gt;
&lt;br /&gt;
* AS/400 (iSeries)&lt;br /&gt;
* Caché&lt;br /&gt;
* Filemaker&lt;br /&gt;
* Firebird&lt;br /&gt;
* Informix&lt;br /&gt;
* Ingres&lt;br /&gt;
* Interbase&lt;br /&gt;
* Lotus Notes&lt;br /&gt;
* Mimer SQL&lt;br /&gt;
* Pervasive&lt;br /&gt;
* Postgre SQL&lt;br /&gt;
* Progress&lt;br /&gt;
* SQLite&lt;br /&gt;
* Teradata&lt;br /&gt;
&lt;br /&gt;
These support the OLE DB interface (Analytica uses straight ODBC) and thus may be usable (I'm not totally sure):&lt;br /&gt;
* Microsoft Project&lt;br /&gt;
* Lightbase&lt;br /&gt;
* SQLBase&lt;br /&gt;
* VistaDB&lt;br /&gt;
* Active Directory&lt;br /&gt;
&lt;br /&gt;
= 64-bit ODBC Drivers =&lt;br /&gt;
&lt;br /&gt;
To use ODBC from Analytica 64-bit, you must have 64-bit versions of the ODBC driver for your database.  Microsoft SQL Server, Oracle, MySQL and most other major commercial databases provide 64-bit ODBC drivers, and can be used with Analytica 64-bit.  &lt;br /&gt;
&lt;br /&gt;
The Microsoft JET drivers (for Microsoft Access, Microsoft Excel and CSV file queries) require Microsoft Office 2010 or later, and you must install the x64 edition of Office.  Prior to the Office 2010 release, 64-bit drivers were not available.  If you install Office 2010 x64, then you can query Access, Excel, or flat files directly via ODBC.&lt;br /&gt;
&lt;br /&gt;
Without MS Access x64 installed (e.g., if you have only Office 2003 or 2007), you won't be able to query an Access database directly.  There is a method, however, of querying a Microsoft Access database from Analytica 64-bit by configuring the free Microsoft SQL Server express driver to act as a proxy to the Access database.  The steps for doing this are detailed at [[Querying Access database from Analytica 64]].  Again, this is now unnecessary if you have MS Access 2010 x64.&lt;br /&gt;
&lt;br /&gt;
= Library =&lt;br /&gt;
&lt;br /&gt;
Database Functions&lt;br /&gt;
&lt;br /&gt;
= Additional Help =&lt;br /&gt;
&lt;br /&gt;
* Follow a step-by-step mini-tutorial to get your first DbQuery working with a Microsoft Access database here: [[DbQuery/Step-by-Step querying Microsoft Access]]&lt;br /&gt;
&lt;br /&gt;
* An Analytica User Group webinar on the use of DbQuery to read data in relational databases can be viewed at: [http://AnalyticaOnline/WebinarArchive/2008-02-07-Using-ODBC-Queries.wmv Using-ODBC-Queries.wmv].&lt;br /&gt;
&lt;br /&gt;
* A bug has been identified in 4.0 (fixed in 4.1) that causes the following message to appear incorrectly in some circumstances:&lt;br /&gt;
 First arg, &amp;lt;rowIndex&amp;gt;, to DBLabels must be defined with a DBQuery( ) statement&lt;br /&gt;
The bug only occurs when the node holding the DbQuery is an index node that has just been defined.  If you use a Variable node, rather than an index node, the problem does not occur, or if a model is saved and reloaded the problem does not occur.  If you change the index to a variable node, you must force the definition to be re-evaluated, such as by inserting a space in the definition.  If you encounter this problem when it should not be appearing, our recommendation is to save and reload the model, which will correct the problem.&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[DbTable]]&lt;br /&gt;
* [[DbLabels]]&lt;br /&gt;
* [[DbWrite]]&lt;br /&gt;
* [[SqlDriverInfo]] -- Note: [[SqlDriverInfo]](&amp;quot;&amp;quot;) returns list of drivers&lt;br /&gt;
* [[OpenExcelFile]], [[WorksheetCell]], [[WorksheetRange]] -- alternative functions for reading from Excel sheets (Ana 4.1+)&lt;br /&gt;
* [[ReadCsvFile]]&lt;br /&gt;
* [[ReadTextFile]]&lt;br /&gt;
* [[MdxQuery]] -- for querying OLAP services&lt;br /&gt;
* [[Querying Access database from Analytica 64]]&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Logical_Operators&amp;diff=19407</id>
		<title>Logical Operators</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Logical_Operators&amp;diff=19407"/>
		<updated>2011-01-05T00:41:09Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Or */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Operators]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logical operators are used to combine boolean assertions.  Analytica uses the values True=1 and False=0.  &lt;br /&gt;
&lt;br /&gt;
When applied to values other than 0 or 1, other parameter values are interpreted as follows:&lt;br /&gt;
* a '''non-zero numeric''' is treated as true&lt;br /&gt;
* '''NaN''' is treated as ambiguous (could be 0 or 1)&lt;br /&gt;
* '''Null''' results in a warning, with a Null result.&lt;br /&gt;
* Any '''other''' data type results in an error.&lt;br /&gt;
&lt;br /&gt;
Note: The value special Undefined is considered deprecated in Analytica 4.0.  Null is now used exclusively for a non-existent value from within Analytica expressions.&lt;br /&gt;
&lt;br /&gt;
[[INF, NAN, Null, and Undefined]]&lt;br /&gt;
= And =&lt;br /&gt;
&lt;br /&gt;
 A And B&lt;br /&gt;
&lt;br /&gt;
True if both A and B are true.  False if either A or B is false.&lt;br /&gt;
&lt;br /&gt;
In this table, x signifies a numeric value that is not equal to zero (and is not NaN).&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! And !! &amp;amp;nbsp;&amp;amp;nbsp;0&amp;amp;nbsp;&amp;amp;nbsp; !! x !! NaN !! Null &lt;br /&gt;
|-&lt;br /&gt;
! 0 || 0 || 0 || 0 || Null&lt;br /&gt;
|-&lt;br /&gt;
! x || 0 || 1 || NaN || Null &lt;br /&gt;
|-&lt;br /&gt;
! NaN || 0 || NaN || NaN || Null&lt;br /&gt;
|-&lt;br /&gt;
! Null || Null || Null || Null || Null &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Or =&lt;br /&gt;
&lt;br /&gt;
 A or B&lt;br /&gt;
&lt;br /&gt;
True if A or B or both are true.  &lt;br /&gt;
&lt;br /&gt;
In this table, x signifies a numeric value that is not equal to zero (and is not NaN).&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Or !! &amp;amp;nbsp;&amp;amp;nbsp;0&amp;amp;nbsp;&amp;amp;nbsp; !! &amp;amp;nbsp;&amp;amp;nbsp;x&amp;amp;nbsp;&amp;amp;nbsp; !! NaN !! Null &lt;br /&gt;
|-&lt;br /&gt;
! 0 || 0 || 1 || NaN || Null &lt;br /&gt;
|-&lt;br /&gt;
! x || 1 || 1 || 1 || Null&lt;br /&gt;
|-&lt;br /&gt;
! NaN || NaN || 1 || NaN || Null&lt;br /&gt;
|-&lt;br /&gt;
! Null || Null || Null || Null || Null &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Not =&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Not !! &amp;amp;nbsp;&amp;amp;nbsp;0&amp;amp;nbsp;&amp;amp;nbsp; !! &amp;amp;nbsp;&amp;amp;nbsp;x&amp;amp;nbsp;&amp;amp;nbsp; !! NaN !! Null &lt;br /&gt;
|-&lt;br /&gt;
! || 1 || 0 || NaN || Null &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Concat&amp;diff=19344</id>
		<title>Concat</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Concat&amp;diff=19344"/>
		<updated>2010-12-22T20:53:37Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Array Functions]]&lt;br /&gt;
[[Category:Doc Status D]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Concat(A,B'',I,J,K'') =&lt;br /&gt;
&lt;br /&gt;
Concatenates lists or arrays.&lt;br /&gt;
&lt;br /&gt;
When A and B are 1-D arrays,&lt;br /&gt;
 Concat(A,B)&lt;br /&gt;
returns a list (1-D array) consisting of their elements.  This form is often used to concatentate two indexes to obtain the elements for a third index.&lt;br /&gt;
&lt;br /&gt;
When A and B are 1-D arrays with a common index&lt;br /&gt;
&lt;br /&gt;
 Concat([A],[B])&lt;br /&gt;
returns a 2-D array with two columns.  Notice square brackets surrounding the variables.  If only two parameters are used, column index is .K.  &lt;br /&gt;
&lt;br /&gt;
When A and B are arbitrary arrays, where A has index I and B has index J, then &lt;br /&gt;
 Concat(A,B,I,J,K)&lt;br /&gt;
concatenates (i.e., joins) arrays A and B, with the new result indexed by K.  You must provide an index K whose length is the sum of the lengths of I and J.  Often the index K is obtained using the first form of concatenate.&lt;br /&gt;
&lt;br /&gt;
(new to 4.1) You can omit the K parameter:&lt;br /&gt;
 Concat(A,B,I,J)&lt;br /&gt;
when you do so, the function creates a new local index named K for the result.&lt;br /&gt;
&lt;br /&gt;
= Library =&lt;br /&gt;
&lt;br /&gt;
Array functions&lt;br /&gt;
&lt;br /&gt;
= Examples  =&lt;br /&gt;
&lt;br /&gt;
 Index In1&amp;amp;nbsp;:= ['a','b','c']&lt;br /&gt;
&lt;br /&gt;
 Concat( In1, ['z'] ) &amp;amp;amp;rarry ['a','b','c','z']&lt;br /&gt;
&lt;br /&gt;
 index I&amp;amp;nbsp;:= [1, 2];&lt;br /&gt;
 index J&amp;amp;nbsp;:= ['a', 'b'];&lt;br /&gt;
 index K&amp;amp;nbsp;:= concat(J, 'c');&lt;br /&gt;
 var A&amp;amp;nbsp;:= Array( I, J, 1 );&lt;br /&gt;
 var B&amp;amp;nbsp;:= Array( I, 2 );&lt;br /&gt;
 Concat( A, [B], J, , K)&lt;br /&gt;
 &lt;br /&gt;
 Result:&lt;br /&gt;
    a  b  c&lt;br /&gt;
 1| [1, 1, 2&lt;br /&gt;
 2|  1, 1, 2]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[ConcatRows]]&lt;br /&gt;
* [[ConcatN]]&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Sort&amp;diff=19336</id>
		<title>Sort</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Sort&amp;diff=19336"/>
		<updated>2010-12-21T00:21:51Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Decreasing sort order */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Transforming functions]]&lt;br /&gt;
[[Category:Sorting Functions]]&lt;br /&gt;
''New to Analytica 4.2''&lt;br /&gt;
&lt;br /&gt;
= Sort(A,I) =&lt;br /&gt;
&lt;br /&gt;
Sorts an array ''A'' in ascending order along index ''I''.   The result has the same indexes as the original array, but the elements are re-ordered.&lt;br /&gt;
&lt;br /&gt;
== Comparison to [[SortIndex]] ==&lt;br /&gt;
&lt;br /&gt;
[[Sort]] is equivalent to:&lt;br /&gt;
:A[I=[[SortIndex]](A,I)]&lt;br /&gt;
&lt;br /&gt;
In several respects, [[SortIndex]] is more general than [[Sort]], but in some cases [[Sort]] is more convenient. [[SortIndex]] provides you with the sorted-order, which can then be used to re-index more than one array.  Also, if you are sorting a multi-dimensional array, re-ordering all columns based on the sort-order of one particular &amp;quot;key&amp;quot; column, then you will need to use [[SortIndex]].  When [[SortIndex]](A,I) is applied to a multi-dimensional array, every column is sorted independently.&lt;br /&gt;
&lt;br /&gt;
== Multi-key sorting ==&lt;br /&gt;
&lt;br /&gt;
Like [[SortIndex]], [[Sort]] can be used to perform multi-key sorting.   With [[Sort]], this is most convenient when the key columns are ordered from left-to-right along the ''keyIndex''.  With a multi-key sort, the first column of the array (along the ''keyIndex'') determines the sort order, unless there are ties, in which case the second column breaks the tie.  If there is still a tie, then the third column breaks the tie, and so forth.  The syntax for using  a multi-key sort is:&lt;br /&gt;
:[[Sort]](A,I,keyIndex)&lt;br /&gt;
&lt;br /&gt;
Note that this syntax provides a convenient way to sort a 2-D array, using the first column to determine the sort order for remaining columns.&lt;br /&gt;
&lt;br /&gt;
== Descending sort order ==&lt;br /&gt;
&lt;br /&gt;
The optional parameter ''descending:true'' reverses the sort order, e.g.:&lt;br /&gt;
:[[Sort]](A,I,descending:true)&lt;br /&gt;
&lt;br /&gt;
== Case Sensitivity ==&lt;br /&gt;
&lt;br /&gt;
[[Sort]] compares text values in a case-sensitive fashion, with upper case letter coming before lower-case letters in the sort-order.  For example, &amp;quot;Zebra&amp;quot; comes before &amp;quot;apple&amp;quot;.  The optional ''caseInsensitive:true'' parameter causes comparisons to occur in a case-insensitive fashion:&lt;br /&gt;
:[[Sort]](A,I,caseInsensitive:true)&lt;br /&gt;
&lt;br /&gt;
= Library =&lt;br /&gt;
&lt;br /&gt;
Array functions&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
Suppose &lt;br /&gt;
{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
! &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A &amp;amp;rarr; ||&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! !!colspan=&amp;quot;3&amp;quot; | J&lt;br /&gt;
|-&lt;br /&gt;
!rowspan=&amp;quot;5&amp;quot; | I&lt;br /&gt;
| 3 || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 3 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 1 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 1 || 2&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
! &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[Sort]](A,I) &amp;amp;rarr; ||&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! !!colspan=&amp;quot;3&amp;quot; | J&lt;br /&gt;
|-&lt;br /&gt;
!rowspan=&amp;quot;5&amp;quot; | I&lt;br /&gt;
| 1 || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 2 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 2 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 3 || 2&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot;&lt;br /&gt;
! &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; [[Sort]](A,I,keyIndex:J) &amp;amp;rarr; ||&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! !!colspan=&amp;quot;3&amp;quot; | J&lt;br /&gt;
|-&lt;br /&gt;
!rowspan=&amp;quot;5&amp;quot; | I&lt;br /&gt;
| 1 || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 3 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 1 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 1 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 2 || 1&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
 &lt;br /&gt;
* [[SortIndex]]&lt;br /&gt;
* [[Rank]]&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
	<entry>
		<id>https://docs.analytica.com/index.php?title=Cdf_and_Pdf_Functions&amp;diff=19243</id>
		<title>Cdf and Pdf Functions</title>
		<link rel="alternate" type="text/html" href="https://docs.analytica.com/index.php?title=Cdf_and_Pdf_Functions&amp;diff=19243"/>
		<updated>2010-11-24T19:06:39Z</updated>

		<summary type="html">&lt;p&gt;J bryan: /* Detailed Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Statistical Functions]]&lt;br /&gt;
[[Category:Doc Status C]] &amp;lt;!-- For Lumina use, do not change --&amp;gt;&lt;br /&gt;
[[What's new in Analytica 4.0?]] &amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PDF(X) and CDF(X)===&lt;br /&gt;
(New to 4.0)&lt;br /&gt;
These functions generate histograms for a sample for quantity X. They are similar to the methods used to generate uncertainty views of sample values, PDF or CDF, for graphs or tables. But, as functions, they return results as arrays available for further processing, display, or export. They can also generate histograms for data with indexes other than Run, the default for uncertain samples.  PDF generates a mass function or density function according to whether X is discrete or continuous. CDF generates a cumulative mass or cumulative distribution function. They can also generate Histograms&lt;br /&gt;
&lt;br /&gt;
==== Simple Usage ====&lt;br /&gt;
&lt;br /&gt;
A common use is to generate the PDF or CDF table of an uncertain variable X, generated as a random sample, e.g.:&lt;br /&gt;
&lt;br /&gt;
 PDF(X)&lt;br /&gt;
 CDF(X)&lt;br /&gt;
&lt;br /&gt;
Here the distribution, Ch1, contains uncertainty, and is therefore has a sample indexed by Run.&lt;br /&gt;
&lt;br /&gt;
==== Histograms ====&lt;br /&gt;
&lt;br /&gt;
You can also use PDF and CDF to generate histograms of data that is not uncertain, i.e. indexed by something other than '''Run'''.  For example, to generate a histogram of Y over index J, use:&lt;br /&gt;
&lt;br /&gt;
 PDF(Y, J)&lt;br /&gt;
&lt;br /&gt;
==== Parameters====&lt;br /&gt;
&lt;br /&gt;
'''PDF''' and '''CDF''' have one required parameter:&lt;br /&gt;
:'''X''': The sample data points, indexed by I&lt;br /&gt;
and several optional parameters:&lt;br /&gt;
:'''i''': The index over which they generate the histogram. By default this is Run -- i.e. a Monte Carlo sample -- but you can also specify another index to generate a histogram over another dimension.&lt;br /&gt;
:'''w''': The sample weights.  Can be used to weight each sample point differently. Defaults to system variable '''SampleWeights'''.&lt;br /&gt;
:'''discrete''': Set true or false to force [[#Is the distribution discrete or continuous? | discrete or continuous]] treatment.&lt;br /&gt;
:'''binMethod''': Selects the histogramming method used. Otherwise it uses the system default set in the '''Uncertainty setup''' dialog from the '''Result''' menu. Options are:&lt;br /&gt;
:: 0 &amp;quot;equal-X&amp;quot;: Equal steps along the X axis (values of X).&lt;br /&gt;
:: 1 &amp;quot;equal-sample-P&amp;quot;: Equal numbers of sample values in each step.&lt;br /&gt;
:: 2 &amp;quot;equal-weighted-P&amp;quot;: Equal sum of weights of samples, weighted by '''w'''.&lt;br /&gt;
&lt;br /&gt;
:'''samplesPerStep''': An integer specifying the number of samples per bin. Otherwise it uses the system default set in the '''Uncertainty setup''' dialog from the '''Result''' menu.&lt;br /&gt;
:'''domain''': Name of a variable whose Domain attribute should be used (see below)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[Syntax]]: PDF(x: [I]; I: IndexType=Run; w: NonNegative[I]=SampleWeighting; discrete: optional boolean; binMethod, samplesPerStep: optional positive; domain: Unevaluated = x)&lt;br /&gt;
&lt;br /&gt;
;[[Syntax]]: CDF(x: [I]; I: IndexType=Run; w: NonNegative [I]=SampleWeighting; discrete: Optional Boolean; binMethod, samplesPerStep: Optional Positive; domain: Unevaluated = x)&lt;br /&gt;
&lt;br /&gt;
==== Is the distribution discrete or continuous? ====&lt;br /&gt;
&lt;br /&gt;
'''PDF(X)''' generate a probability mass function or density function according to whether it thinks '''X''' is discrete or continuous. '''CDF(x)''' does the same, generating a cumulative mass or cumulative probability function.  If '''X''' contains text values it knows '''X''' must be discrete. If '''X''' contains numbers with few or no identical values, it guesses continuous. If '''X''' contains numbers with many identical values, it guesses discrete.  &lt;br /&gt;
&lt;br /&gt;
Usually, they guess correctly. But, sometimes, such as with discrete distributions over a wide range of integers, it may be ambiguous. In such cases, there are two ways to make sure it does what you want:&lt;br /&gt;
&lt;br /&gt;
* If '''X''' is a variable, you can set its '''Domain''' attribute as:&lt;br /&gt;
** '''Continuous'''&lt;br /&gt;
** '''Discrete Numeric''', '''Categorical''', '''List of Numbers''', '''List of Labels''', or '''Index''' -- all of which it treats a discrete. &lt;br /&gt;
** '''Automatic''' is the default, meaning Analytica guesses.&lt;br /&gt;
&lt;br /&gt;
* If '''X''' is an expression, set the optional parameter '''Discrete''' to '''PDF''' or '''CDF''' as True or False&lt;br /&gt;
&lt;br /&gt;
If '''X''' contains text values, i.e. categorical data, you may want to control the order of the categories, e.g. [&amp;quot;Low&amp;quot;, &amp;quot;Medium&amp;quot;, &amp;quot;High&amp;quot;]. You can do this by specifying the its Domain as a List of Labels with these values, or as an '''Index''', referring to an Index using them.  Alternatively, you can provide a list of labels to the optional '''Domain''' parameter of '''PDF''' or '''CDF'''. If '''X''' is an expression rather than a variable, this is your only choice.&lt;br /&gt;
&lt;br /&gt;
=== Weighted Data ===&lt;br /&gt;
&lt;br /&gt;
Normally, each point in a data set or sample carries equal weight.  However, in some situations data or sample points may have unequal weights.  When the running index is Run (i.e., the case of variables with uncertainty), the SampleWeighting system variable provides the default weighting (which itself defaults to equally weighted points).  The default weighting can be provided explicity using the w parameter, for example:&lt;br /&gt;
&lt;br /&gt;
 PDF( Total_revenue, w: (SalesByRegion&amp;lt;ProjectedSales)[Region='East Coast'] )&lt;br /&gt;
&lt;br /&gt;
This expression computes the posterior probability of total revenue given that the east coast sales are less than projected, which is accomplished by providing a zero weight for all points not consistent with the assumption.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Detailed Description ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Text below needs editing''&lt;br /&gt;
PDF and CDF behave differently depending on whether the domain of x is discrete or continuous.  PDF and CDF determine whether the domain is discrete or continuous as follows.  If x contains non-numerics, then the domain is discrete.  Otherwise, if the optional discrete parameter is specified, its value (true=discrete, false=continuous) is used.  Otherwise, if the domain parameter contains a variable identifier, the domain attribute for that variable is consulted.  (The user of PDF/CDF would seldom, if ever, explicitly specify the domain parameter, but if the first parameter to PDF/CDF is a variable identifier, then the domain parameter will pick that up).  If the domain attribute is set to Continuous, then a continuous domain is used.  If it is set to Discrete (numeric or categorical), if the domain is an explicit list or list of labels, or if it is set to an Index, then a discrete domain is used.  Otherwise (i.e., the domain attribute is &lt;br /&gt;
automatic&amp;quot;, or the domain parameter is not a variable identifier, PDF uses some heuristics to &amp;quot;guess&amp;quot; whether x is discrete numeric or continuous.  The heuristics judge such things as whether the value in x appear to be regular integer multiples (as would occur from a discrete distribution such as Poisson or Binomial).  &lt;br /&gt;
&lt;br /&gt;
When PDF/CDF uses a discrete domain, the domain parameter contains a variable identifier, and the domain attribute of that variable contains an explicit list of values, or an index with explicit values, then those values are used, in that order, as the domain of PDF/CDF.  If no such domain declaration is available, then the set of unique values in x are used as the domain.  If a variable with an explicit domain was found, that variable serves as the index of possible values.  If so such domain variable was utilized, a local magic &amp;quot;magic&amp;quot; local index named &amp;quot;PossibleValues&amp;quot; is used.  The result is indexed either by this domain index or the local &amp;quot;PossibleValues&amp;quot; index.   The value in each cell of the array is the relative frequency of occurrence of that value.&lt;br /&gt;
&lt;br /&gt;
When PDF uses a continuous domain, the result will be indexed by &amp;quot;Step&amp;quot; and &amp;quot;DensityIndex&amp;quot; (plus any abstracted indexes in the parameters).  Step is a &amp;quot;magic&amp;quot; local index with the name &amp;quot;Step&amp;quot;.  DensityIndex is a system variable index containing two elements, [&amp;quot;X&amp;quot;, &amp;quot;Y&amp;quot;].  The &amp;quot;X&amp;quot; column of the result contains the centroid for each &amp;quot;bin&amp;quot; of the histogram, while the &amp;quot;Y&amp;quot; column contains the density estimate for that bin.&lt;br /&gt;
&lt;br /&gt;
To construct a continuous PDF/CDF, the algorithm must partition the set of reals into bins.  The key operation is determining where to place these bins (or, more accurately, the boundaries between these bins).  There are three algorithms that may be employed for doing this:  EqualX (binMethod=0), Equal Weighted Prob (binMethod=1) and Equal Sample Prob (binMethod=2).  EqualX divides the range of value occurring in X into equal sided intervals.  The Equal Weighted P selects bins with variable sizes so that each bin contains the same amount of weighted probability mass.  The Equal Sample P binMethod selects bins with variable sizes so that roughly the same number of points fall into each bin.  (With a constant weighting, Equal Weighted P and Equal Sample P should be identical, up to numeric round-off effects).  The samplesPerStep controls how finely partitioned the histogram is, specifying how many points, on average, should land in each bin.  These controls can be supplied explicitly via optional parameters to PDF or CDF, or if they aren't specified, PDF will obtain them from the settings specified on the Uncertainty Settings dialog.  If x (i.e., domain) is a variable identifier, then the local settings for that variable are used, otherwise, the local settings for the variable whose definition contains the call to PDF is used.  If that is not set, then the global settings are used.  Analytica defaults to an EqualX binMethod for PDF, and an EqualP method for CDFs.&lt;br /&gt;
&lt;br /&gt;
Once the bins are selected, the density estimate is just the ratio of the proportion of points in the bin divided by the bin's width.&lt;/div&gt;</summary>
		<author><name>J bryan</name></author>
	</entry>
</feed>