Excel: connect with AS cube to get cardinality

Copper Contributor

Hi Team,  I'm connecting excel workbook with our production cube to get following details.

 

TheTallman_0-1626061576623.png

then I'm using this info to get cardinality and visible information and further using vlookup to put in recon workbook.

TheTallman_1-1626061665630.png

 

I want to make it automate through macro and expecting these things through command button ..

1. make cube connection and once button pressed , output of this mdx  "SELECT * FROM $System.MDSCHEMA_DIMENSIONS" should be pulled in excel and vlookup get active and put requested information in recon workbook.

 

Excel file is attached . 

 

2 Replies

@TheTallman Not sure what you trying to achieve with the formulae provided in your example workbook, as they are incorrectly applying the VLOOKUP function. It seems to work but that's only by coincidence,as both data sets are sorted in the exact same way. I've corrected them in the attached workbook,

 

Then, my question would be why not just take the last three columns from the cube-output and paste in the recon sheet. No need for lookups at all. If you insist, you could record a macro picking-up all the consecutive steps needed. I.e. open the data file, copy the data, paste it in the "Cube Output" sheet, copy the last three columns, paste them into the "Recon" sheet.

 

Now, if in reality it isn't all that simplistic, perhaps you can set-up PowerQuery (PQ) to connect to your data source and transform/extract whatever sub-set of data you need. No need fro VBA or VLOOKUP.

The PowerQuery option sounds the best and most efficient way of doing this, especially with large datasets.