Sunteți pe pagina 1din 7

CreateOLAPCube

ThisarticledescribeshowtocreateanOLAPcubefile,whichcanbeusedwithExcel
Pivottablesandcharts,orourexcellentOLAPTool.

WhatisOLAP
OLAPstandsforOnLineAnalyticalProcessingaconceptneithernew,noruncomplicated.Use
OLAPwhenyouwanttoorganizealotofdata,forinstanceseveralyearsofsalesrecordsinto
simple,understandablegraphsandtables.

WhatKindofData
OLAPinvolvesworkingwithinformation,whereyouwanttogroupdata,inordertosummarize
numericalfields,ortocountoccurrencesorgetthehighest/lowestvalueinaseriesofdata.
Thus,yourdatashouldcontainnumericalinformation,suchassalestotals,worktime,
productiontotalsetc.

WhatKindofDatabases
YoucanuseOLAPTooltoconnecttoseveraldifferentdatabases.Itisrequiredthatyouhavean
ODBCdatasourceforthatdatabaseinstalledandconfiguredonyourclientcomputer.Howto
setupanODBCdatasourceforyourparticulardatabaseisbeyondthescopeofthisdocument.
PleasecontactyourITstaffforhelp.

MicrosoftQuery
TobeabletocreateanOLAPcubefromtheinformationinthedatabase,wemustbeableto
structurethedataasasingletablecontainingtheinformationwewant.Todothis,weusea
toolcalledMicrosoftQuery,whichcomeswithMicrosoftExcel.
ThesimplestwaytostartMicrosoftQueryisfromExcel.Selectfromthemenu"Data>
PivotTableandPivotChartReport"Thedialogbelowwillopen.


Select"Externaldatasource"andpressNext.

Press"GetData"ThisstartsMicrosoftQuery(inbackground)andopensthe"ChooseData
Source"dialog.
(Note:YoucanalsostartMicrosoftQuerydirectly.ItiscalledMSQRY32.EXEandcanbefoundin
yourMicrosoftOfficeinstallationfolder.)

ConnectingtotheDatabase
Thestepsinvolvedtoconnecttoyourdatabasevaryalittledependingonthetypeofyour
database.Inthisexample,wewillconnecttoanAccessdatabasefile(mdbfile).


Select"MSAccessDatabase*"andpressOK.Afilebrowserdialogwillopen.FindyourAccess
databasefile,markitandpressOK.

CreatingtheQuery
Afteryouhaveconnectedtoyourdatabase,theQueryWizardwillhelpyourcreateyour
databasequery,inordertocreatetheOLAPcube.Firststepinvolvesselectingthetablesand
fieldsyouareinterestedin.Inthisexample,weusetheMicrosoftNorthwindexampledatabase.
Weareinterestedincustomersandtheorderstheyhaveplaced,theproductstheyorderedand
thequantityandsubtotalsoftheorders.

Fromthemanytablesofinformation,weselectCompanyNameandCountryfromthe
Customerstable,Quantity,SubtotalandOrderDatefromOrderstables,andProductNameand
CategoryNamefromtheProducttables.

Pressing"Next"opensthechosentablesinMicrosoftQuery.

AftermovingaroundthetablesinMSQueryforbetteroverview,wecannoweasilyseethe
tables,fieldsandtherelationsbetweenthem.Thisisagoodwaytoverifythelogicand
consistencyofyourqueryanddata.Insomecases,youmayhavetolinktherelationsthatMS
Querycannotidentifyautomatically.


ThetableofdatalistedbelowinMSQueryshowsustheresultofthequery.Thisisalsoagood
waytoverifythequery.Ifyouenlargethetable,youcanseethatitnowcontainsthe
informationweareinterestedinallinonesimpletable.Eachrowcontainsinformationabout
oneproductorder,togetherwithinformationaboutthecustomernameandcountry,the
quantityandsubtotaloftheorder,theorderdateandtheproductnameandcategory.
Youcanrenamethefieldstomoreuserfriendlynames.Selectacolumnandchoose"Records
>Editcolumn"
WearenowreadytocreatetheOLAPcube.

CreatingtheOLAPCubeFile
WithinMicrosoftQuery,selectthemenuoption"File>CreateOLAPCube"Thiswillopenthe
OLAPCubeWizard.

Thefirststepinvolvesselectingthefieldsthatyouwanttomakeavailableassummarizedfields
intheOLAPcube.Selectthefields,themethodofsummaryandgivethefieldaname.Press

"Next"whenyouaredone.

Nextstepinvolvescreatingthedimensionsofthecubefile.Adimensionisoneoragroupof
fieldsthatcanbeselectedtoanaxisinatable.Draganddroptheavailablefieldstocreatenew
dimensionsorgroupsinthesamedimension.Inthisexample,wehavecreatedthree
dimensionsCustomer,ProductandOrderDate.Eachdimensioncontainstwoormorelevelsof
detail.Youcanalsorenamethefieldsanddimensions,togivethemmoresuitablenames.Press
"Next".


Thefinalstepinvolvessavingthecubefile.TobeabletousethecubewithourExcelOLAPTool,
youhavetosavethefilewithalldatainit,andsavethefileinthesavefolderasOLAPTool.
Selectafilenameforthecubefile,endingwith.cub.Press"Finish"tosavethefile.
YouhavenowcreatedanOLAPcubefile.PleasecontactusformoreinformationandOLAP
solutions.

S-ar putea să vă placă și