Command Line in Askiaanalyse

Command Line in Askiaanalyse


Table of contents:

Since version, askiaanalyse can be used via command line which is extremely useful with askiavista's automated & scheduled tasks.

You can invert data stored in SQL Server.
This feature is crucial when askiafield surveys are initialized in SQL Server in the CCA.
This feature is used by askiavista to have retrieve live survey data in order to display up to date analysis results.
Note: We will add further functionality as requests are made.

This feature has been updated from version 5.3.1 to use a temporary directory during the inversion process, minimizing system downtime while running the inversion.


Here the list of arguments which can appear in the command line to start askiaanalyse:

Argument Value Description
{None} String Path of survey file, QES, specificed between quotes "
/invert - Use to invert the data
/partialinvert - Attempt to invert the database incrementally (only adding new interviews)
/verifyinvert - Verifies the number of interviews between inverted DB and DB are the same and inverts if needed (as of v5.3.5 this argument appears to also execute the "recalculate variable" function)
/type: Integer Defines the type of survey and/or data, for example: /type:5
/type:0 Data stored in a QES file
/type:1 Dimension file (PKD, SAV, etc...)
/type:2 Multiple askia surveys QEM, (see note1)
/type:3 askiasurf QEW file
/type:4 Data stored in SQL Server Legacy format (multiple tables)
/type:5 Data stored in SQL Server new format (single table)
/surveyId: Integer Defines the ID of a survey when the data is stored in the SQL Server, /type:4, for example: /surveyId:119
/surveyConnection: String Defines the connection string to the survey data stored in SQL Server and/or Dimensions, for example:
/surveyConnection:"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=UID;password=PWD;Initial Catalog=Surveys;Data Source="
/recalculatevariables - Recalculate all variables
/exportword - Export portfolio to word - requires /portfolio and /output, optional script
/exportexcel - Export portfolio to excel - requires /portfolio and /output, optional script
/exportppt - Export portfolio to ppt - requires /portfolio and /output, optional script
/exporttabsml - Export portfolio to TabsML - requires /portfolio and /output, optional script
/exportascii - Export portfolio to Ascii - requires /portfolio and /output, optional script
/exportsptoinv -

Export a sub population to an inverted QES - requires /script, /output, optional /calculated, /exclude

/"questions:" String

A selection of questions can be chosen when exporting to inverted database. e.g. /"questions:gender;age;rating"

/portfolio: String Path of the portfolio. From Analyse 64 bit 11/10/2016 onwards, can also use /portfolio2, /portfolio3, /portfolio4 etc. - see third example below.
/output: String Path of the file to export. From Analyse 64 bit 11/10/2016 onwards, can also use /output2, /output3, /output4 etc. - see third example below.
/script: String Script to define a sub-population
/calculated: String List of calculated questions needed eg /"calculated:weighting1;weighting2;timingondemographics"
/exclude: String List of excluded questions eg /"exclude:wave;bankaccount"
/hkcu -

This uses the current user settings and not the local machine's settings which are default (HKCM). Use this parameter if tab or general settings don't match your manual output.

/replacetabtemplate: String

/replacetabtemplate:"OldTabTemplate|NewTabTemplate" - use this for replacing tab-templates before running an export from the command line. You can call this parameter more than once to change more than one tab-template. If the tab-template is not recognised, an error will be written in the log file (if you have specified one).

/logfile: String

/"logfile:Log.txt" - Creates a date time stamped list of all command syntax run which referred to the specified log file. New runs are appended to the bottom for the log file.

/startsheet: Integer

/startsheet:5 (default 1) - specify the number of the starting sheet when exporting to excel from the command line. This does not override the option 'Use portfolio titles for sheet names' - you either have to have a tab definition with no title or have the option set to 'No'

/automate: String

/"automate:CreateSummaryTabs.txt" specify the generic script file to create portfolios such as summary tabs or hole-counts from the command line. You can specify where to save the newly created portfolio in the automation script and then open this and export to Excel in a following command.

/completesonly: Number

Number values take 0 & 1. Place the parameter after your data file in the command line. /completesonly:1 will set Analyse to show only completes. /completesonly:0 will set Analyse to show completes and incompletes.


1. Recalculate and Invert  data  of a qes file when data are stored in SQL server

Analyse.exe "C:\MyQes\Ex.qes" /surveyconnection:"Provider=sqloledb; Data Source=XXXXXXX; Initial Catalog=Surveys;Trusted_Connection=no;User Id=XXXXXX;Password=XXXXX";" /surveyid:249 /type:5 /recalculatevariables /invert

2. Export to inverted format of a surf file with calculated questions

AnalyseU.exe "C:\My QEWs\Ex.qew" type:3 /exportsptoinv /"script:??Lang?? Has 1" /"calculated:Weighting" /"exclude:Wave" /"output:C:\My Qes\reduced.qes" 

3. Export of a portfolio to Excel on a sub-population

AnalyseU.exe "C:\My QES\Ex.qes"  /exportexcel /"script:??Lang?? Has 1" /"portfolio:C:\My QES\MyAnalysis.xml" /"output:C:\My Qes\result.xls" 

4. Export multiple portfolios to multiple Excel files in a single command / session of Analyse:

(Only available from Analyse 64 bit 11/10/2016 onwards)

Analyse.exe "c:\qes\me\ex.qes" /exportexcel /portfolio:"c:\qes\me\p1.xml" /output:"c:\qes\me\p1.xlsx" /portfolio2:"c:\qes\me\portfolio.xml" /output2:"c:\qes\me\poorttfolio.xlsx"

5. Replace tab template before exporting: 

Analyse.exe "C:\Qes\ex.qes" /exportexcel /"portfolio:C:\Qes\JustCount.xml" /"output:C:\Qes\result.xls" /replacetabtemplate:"FlatCount|FlatCountAndPercentage" /"logfile:C:\Qes\Log.txt"

6. Set Start sheet in Excel to be 5:

Analyse.exe "C:\Qes\ex.qes" /exportexcel /"portfolio:C:\Qes\JustCount.xml" /"output:C:\Qes\result.xls" /"logfile:C:\Qes\Log.txt" /startsheet:5

7. Run automation script from the command line:

Analyse.exe "C:\Qes\ex.qes" /"automate:C:\Qes\CreateSummaryTabs.txt"

Analyse.exe "C:\Qes\ex.qes" /exportexcel /"portfolio:C:\Qes\CreatedSummaryTabs.xml" /"output:C:\Qes\SummaryTabs.xls"


1. Survey projects using QEM are no longer supported, as this file format has been deprecated since version 5.1.x in askiaanalyse, and version in askiavista. The QEM fomat was made obselete with the release of askiasurf and its much more modern, fexible & powerful QEW format.

Have more questions? Submit a request