Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rahuljattennavar
Partner - Contributor
Partner - Contributor

Dynamically getting the dimensions and measures in a newly created hypercube in qlik sense extension

Hi guys, So, I'm creating a new extension and I want the dimension and measures to be rendered into my newly created hypercube. Right now I have added the dimensions and measures statically,  I want it to be rendered dynamically .The below is the code

app.createCube({
    qDimensions : [{
        qDef : {
            
            qFieldDefs : ["Position"] //dimension value
        }
    // }, 
    // {
    //  qDef : {
    //      qFieldDefs : ["LastName"]
    //  }
    }],
    qMeasures : [{
        qDef : {
            qDef : "Avg(Age)"  //Measure
        }
    }],
    qInitialDataFetch : [{
        qTop : 0,
        qLeft : 0,
        qHeight : 20,
        qWidth : 20
    }]
}, function(reply,app) {
    console.log(layout,app);
    var data = [];

    $.each(reply.qHyperCube.qDataPages[0].qMatrixfunction(indexvalue){
        if(!this[0].qIsEmpty){
            data.push(this[0].qText);
        }
        // console.log(data)
    })
})
 
 
Thank you guys in advance.
Labels (1)
0 Replies