cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Looking for help with matrix

SVanSchoonlandt
Honored Contributor

Hi all,

 

I have created a matrix and used a query to define the cells, however I would like to change the content of the cell from an X to a value I can define myself based on some characteristics. My question, is it possible to define the content when you use query's instead of the link?  If yes, how can I achieve this.

 

Thanks

 

stijn

3 Replies

Hi there,

 

you can always build a macro in an excel spreadsheet. 

Please find below a basic VB macro. It loops the Mega Profile and then for each MetaClass it would do something.

Just update the code to your needs

 

Hope that helps.

 

Sub Export_Profile_All()

Dim oProf, oMC As MegaObject
Dim cProf, cMC As MegaCollection
Dim nRow, nCol As Integer

' connect to Mega
Dim oMegaCurrentEnv As New MegaCurrentEnv
Dim omRoot As MegaRoot
Set omRoot = oMegaCurrentEnv.GetRoot

'get the active sheet
ActiveSheet.Select

Set cProf = omRoot.GetCollection("Profile")
Set cMC = omRoot.GetCollection("MetaClass")

Cells(2, 2) = "Explanations about your matrix"

n = 1
nCol = 3
nRow = 3

    For Each oProf In cProf
        nRow = 3
        Cells(1, nCol) = oProf.GetProp("Name")

        For Each oMC In cMC
            Cells(nRow, 2) = oMC.GetProp("Name")
            Cells(nRow, 1) = oMC.GetProp("Absolute Identifier")
            Cells(nRow, nCol) = "Your Value"
            nRow = nRow + 1
        Next
        nCol = nCol + 4
        n = n + 1
    Next
            

MsgBox "Processing completed"
    
End Sub

 

hi,

 

no matrix is made standard mega (under documentation matrix, new added rows and columns and defined cell with a query), not with the analysis reports.

hsoegaard
MEGA Partner
MEGA Partner

Hi,

 

If the matrix is created in VBs, it should be possible by changing the function  hookCellContent.