PXQ – Saved Query for PX Files

advertisement
PXQ file 11-1
__________________________________________________________________________
PXQ – Saved Query for PX Files
1. General description
It is possible to save a PXQ file which contains information about the retrieval, editing and
calculation that has been recorded and reuse this by calling the PXFileBatch program.
A PXQ file selecting values from a PX file can look like this:
[Query]
Function=selvalues
[Files]
Infile=D:\databas\BE101ACE.px
Outfile=D:\databas\BE101ACEsel.px
Errorfile=D:\databas\betest.err
[Texts]
Text1=and
Text2=by
Text3=distributed
Text4=unit variable
[Var1]
Value1=elim
[Var2]
Value1=1
Value2=2
Value3=3
Value4=4
Value5=5
Value6=6
[Var3]
Value1=1
Value2=2
[Var4]
Value1=1
Value2=2
Value3=3
[Data]
NoOfVar=4
Secrecy=0
[Query]
Function=selvalues indicates what is to be done
PXQ file 11- 2
__________________________________________________________________________
1.1. Functions supported:
Name
Description
see
Selvalues
Aggvalues
Calcvalues
Calcvalues
Calcvalues
Calcvalues
Calcvalues
Calcvalues
Calcvalues
Pivotauto
Pivotmanual
Valueorder
Decimal
Chgtextcontents
Pxfile
Textcode
Vardelete
Splitquarters
Splitmonths
Filecalc
Excel
Asp
Text
dbase1
dbase2
dbase3
dbase4
Graph
Matrix
Lotus
html1
html2
Prnmatrix
Prntable
Reltable
XMLC
Gesmes
Kml
kml2
kml3
select values for new table
select values for new table using aggregation list
Operation 18 - sum
Operation 11 – add
Operation 12 – subtract
Operation 13 – multiply
Operation 14 – divide
Operation 21 - per cent
Operation 33 – deleted value(s)
Change variable order automatically
Change variable order manually
Change value order
Change number of decimals
Change the contents text
Change contents, description, subject, keys
Change between text and code
Delete a variable
Split time variable in year and quarters
Split time variable in year and months
calculate or edit with another table
Convert to Excel
Convert to asp
Convert to text
Convert to dBase, alt 1
Convert to dBase, alt 2
Convert to dBase, alt 3
Convert to dBase, alt 4
Convert to text file suitable for graph
Convert to text file as matrix
Convert to wk1 file format
Convert to html, alt 1
Convert to html, alt 2
Convert to prn, no heading
Convert to prn, as table
Convert to relational table
Convert to XML, Cossi format
Convert to Gesmes format
Convert to Google Earth graph
Convert to Google Earth text
Convert to Google maps
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10.1
2.10.2
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
3.1
3.2
3.3
3.4.1
3.4.2
3.4.3
3.4.4
3.5
3.6
3.7
3.8.1
3.8.2
3.9.1
3.9.2
3.10
3.11
3.12
3.13
3.14
3.15
PXQ file 11-3
__________________________________________________________________________
1.2. In common for pxq files
All pxq will have :
[Files]
Infile=
The PX file to read
Outfile=
The file to write, either a new PX file or some other format depending on function
Errorfile= A file where any messages can be found. Usually only “ended OK”
All PXQ files with functions that create new titles will have:
[Texts]
Text1=and
Text2=by
Text3=distributed
Text4=unit variable
All PXQ files with functions to convert to other file formats will have:
[Data]
Symbol1=.
Symbol2=..
Symbol3=...
Symbol4=....
Symbol5=.....
Symbol6=......
Symbol7=.......
Symbolnil=optional
Textfile=c:\pcaxis\pcaxisen.txt
PXQ file 11- 4
__________________________________________________________________________
2. Funtions to edit and calculate to a new px file
Depending on the function different information is needed as follows.
2.1. Select values
[Query]
Function=selvalues
pxlang=en
descr=0/1
One of the following:
TimeOpt=0 (selected time periods) - default
TimeOpt=1 (only last time period)
TimeOpt=2 (moving time interval)
TimeOpt=3 (fixed start and moving last time)
All variables that exist in the input file
[Var1]
Value1=elim this variable should be eliminated
[Var2]
Value1=1 these should be included
Value2=2
….
….
[Data]
NoOfVar=4 .. How many variables there are in the original PX file time included (help info
for the program)
Secrecy=0
No secrecy option apply
2.2. Select and aggregate values
[Query]
Function=aggvalues
classcat=C:\aggreg
descr=0/1
[Data]
NoOfVar=3
Secrecy=0
[Var1]
Value1=1
[Var2] this variable is to be aggregated
Value1=A;C:\aggreg\10-yearsclasses.agg;1
( A means use aggregation, file name with path, order of the value to use, here =1)
Value2=2 (the second value will be group 2)
Value3=3
PXQ file 11-5
__________________________________________________________________________
Value4=4
Value5=5
[Var3]
Value1=1
Value2=2
[Var4]
Value1=1
Value2=2
[Data]
NoOfVar=4 .. How many variables there are in the original PX file time included (help info
for the program)
Secrecy=0
No secrecy option apply
2.3 Sum within a variable
[Query]
Function=calcvalues
Operation=18
InclExcl=m
(m for include, u for exclude original values)
Newvalue=Total
(the name of the new value)
Order=0
[Var1] ( no sum for this variable)
[Var2] (sum for this variable)
Value1=1
Value2=2
Etc, as many as should be included in the sum
[Var3]
[Var4]
2.4 Add within a variable
[Query]
Function=calcvalues
Operation=11
InclExcl=m
(m for include, m for exclude original values)
Newvalue=Previously married
Order=0
Constant=
(used when a constant is added)
[Var1] for this variable the 3rd and 4th value should be added and given the new value
Value1=3
Value2=4
[Var2]
[Var3]
[Var4]
PXQ file 11- 6
__________________________________________________________________________
2.5 Subtract
[Query]
Function=calcvalues
Operation=12
InclExcl=m
Newvalue=Diff
Order=1 if 1 then subtract value1 – value2 value, if order=2, subtract value2 – value1
Constant=
(used when a constant is added)
[Var1]
[Var2]
[Var3]
[Var4]
for this variable subtract Value1-Value2
Value1=1
Value2=2
2.6 Multiply
[Query]
Function=calcvalues
Operation=13
InclExcl=m
Newvalue=times10
Order=1
Constant=10
[Var1]
[Var2] for this variable the 17th value is to be multiplied by the constant
Value1=17
[Var3]
[Var4]
2.7 Divide
[Query]
Function=calcvalues
Operation=14
InclExcl=m
Newvalue=divided by 10
Betavalue=
Order=1
(compare subtract)
Constant=10
[Var1]
[Var2]
for this variable the 17th value is to be divided by 10
PXQ file 11-7
__________________________________________________________________________
Value1=17
[Var3]
[Var4]
2.8 Per cent calculation
[Query]
Function=calcvalues
Operation=21
InclExcl=m
Newvalue=percent2
Betavalue=percent
if there already is a unit variable in the table
Order=
Constant=
[Var1]
[Var2]
[Var3]
[Var4] for this variable the 3rd value is the base for per cent
Value1=3
2.9 Delete values
[Query]
Function=calcvalues
Operation=33
InclExcl=u
[Var1]
=
[Var2]
=
[Var3]
=
[Var4]
for this variable some values will be deleted
Value1=2
Value2=3
Value3=4
2.10 Pivot
2.10.1 Pivot
[Query]
Function=pivotauto
PXQ file 11- 8
__________________________________________________________________________
PivotAlt=1
Unitvar=Unitvariable
(1 or 2 depending on clockwise or anti clockwise)
2.10.2 Pivot manually
[Query]
Function=pivotmanual
StubOrder=1,3
HeadOrder=2,4
Unitvar=Unitvariable
(the original third variable will be second in stub)
(the original second variable will be first in heading)
2.11 Change value order
[Query]
Function=valueorder
Variablevalues=Region
UnitVar=Unitvariable
[ValueList]
Value1=2
Value2=1
2.12 Change decimals
[Query]
Function=decimals
[Data]
Decimals=2
2.13 Change contents text
[Query]
Function=chgtextcontents
contentstext=new text for contents
2.14 Change description, subject, keys
[Query]
Function=pxfile
descript=new description text
descdefault=0/1
subject=new subject area text
[Data]
PXQ file 11-9
__________________________________________________________________________
keys=0
2.15 Change between text and code
[Query]
Function=textcode
textcodeoptions=2
2.16 Delete variable
[Query]
Function=vardelete
Variable=Region
Titleadd=
Unitvar=Unitvariable
variable to be deleted
value text if it is to be used in title
If one value is to be used in the new table, remove the other
[Remove]
Value1=2
Value2=3
Value3=4
If a sum for the variable is to be used
[Use]
Value1=1
Value2=2
2.17 Split time variable in year and quarter
[Query]
Function=splitquarters
VariableName=Time
NoOfPeriods=12
Firstyear=2005
[Text]
Yeartext=Year
Quartertext=Quarter
Quarter1=Quarter 1
Quarter2=Quarter 2
Quarter3=Quarter 3
Quarter4=Quarter 4
PXQ file 11- 10
__________________________________________________________________________
2.18 Split time variable in year and month
[Query]
Function=splitmonths
VariableName=Time
NoOfPeriods=24
Firstyear=2006
[Text]
Yeartext=Year
Monthtext=Month
Month1=Jan
Month2=Feb
Month3=Mar
Month4=Apr
Month5=May
Month6=Jun
Month7=Jul
Month8=Aug
Month9=Sep
Month10=Okt
Month11=Nov
Month12=Dec
2.19 Calculate with table, or constant
[Query]
Function=filecalc
Operation=
InclExcl=M
Newvalue1=
Newvalue2=
Newvalue3=
NewVar=
Constant=
Matchfile=c:\database\be0101.px
PXQ file 11-11
__________________________________________________________________________
3. Convert to other file formats
3.1 Excel
[Query]
Function=excel
[Data]
datanote=1
rounding=0/1
completeinfo=1
doublecolumn=2
decimals=0
3.2 Text
[Query]
Function=text
[Data]
datanoteoptplace=1
decimalpoint=.
rounding=0/1
rowlength=80
pagelength=60
marglength=4
doublecolumn=0
completeinfo=2
thousand=.
3.3 Asp
[Query]
Function=asp
pxlang=en
guilang=en
Uppercase=0/1
[Data]
stubtype=1
nozero=0
decimalpoint=.
thousand=0
datanoteoptplace=0/1
rounding=0/1
completeinfo=1
doublecolumn=0
1 if zero suppress
PXQ file 11- 12
__________________________________________________________________________
3.4 dBase
3.4.1. dBase 1
[Query]
Function=dbase1
UnitVar=Unitvariable
3.4.2. dBase 2
[Query]
Function=dbase2
3.4.3. dBase 3
[Query]
Function=dbase3
3.4.4. dBase 4
[Query]
Function=dbase4
[Data]
completeinfo=0
doublecolumn=0
3.5 Graph
[Query]
Function=graph
iteration=1
textdelim=
[Data]
decimalpoint=.
rounding=0/1
3.6 Matrix
[Query]
Function=matrix
iteration=
textdelim=
PXQ file 11-13
__________________________________________________________________________
[Data]
rounding=0/1
decimalpoint=,
3.7 Lotus
[Query]
Function=lotus
3.8 Html
3.8.1. Html 1
[Query]
Function=html1
[Data]
rounding=0/1
3.8.2. Html 2
[Query]
Function=html2
[Data]
rounding=0/1
3.9 PRN – CSV delimited file
3.9.1. matrix
[Query]
Function=prnmatrix
[Data]
delim=,
rounding=0/1
3.9.2. table
[Query]
Function=prntable
[Data]
delim=tab
rounding=0/1
PXQ file 11- 14
__________________________________________________________________________
3.10 Relational table
[Query]
Function=reltable
textdelim=
iteration=
[Data]
decimalpoint=,
rounding=0/1
3.11 XML – PXML, CoSSI
[Query]
Function=XMLC
XMLtype=2
Language=sv
IncDtd=0/1
[Data]
rounding=0/1
1=keys, 2=XDF, 3=Cals
1 if dtd is to be used
3.12 Gesmes
[Query]
Function=gesmes
Unitvar=Unitvariable
3.13 Google Earth graph
[Query]
Function=kml
[Data]
rounding=0
coordinates=C:\database\KML
completeinfo=0
doublecolumn=0
3.14 Google Earth text
[Query]
Function=kml2
[Data]
PXQ file 11-15
__________________________________________________________________________
rounding=0
coordinates=C:\database\KML
completeinfo=0
doublecolumn=0
3.15 Google Maps
[Query]
Function=kml3
[Data]
rounding=0
coordinates=C:\database\KML
completeinfo=0
doublecolumn=0
Download