Using MDX for extracting data using API
In this recipe, we will extract data using the APIs in Excel and an MDX script. We will be using the Visual Basic editor to load the smartviewvba.bas
file, enter the code needed to connect to Essbase, and extract data specified in our MDX script. In addition, we will conduct a similar task manually using the Execute MDX option in Smart View.
Getting ready
To get started, click on the Start menu and navigate to Programs | Microsoft Office | Excel.
How to do it...
In Excel, click on Sheet1 and press Alt+F11. You will launch Microsoft Visual Basic editor, which should look like the following screenshot:
Right-click on Microsoft Excel Objects under VBAProject (Book1), click on Import File..., in the Import File menu, browse to C:\Oracle\SmartView\Bin, click on SmartviewVBA.bas, and click on the Open button. You should see the file imported under the Modules folder.
Double-click on the SmartviewVBA module and type the following database constant variables below...