Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

prabhuappu
Contributor II

How to create a Master item in Qliksense using SDK?

Hi All,

How to create master item or add an existing object to master library using SDK.

regards,

Prabhu Appu

1 Solution

Accepted Solutions
Not applicable

Re: How to create a Master item in Qliksense using SDK?

Hi Prabhu,

Class AppExtensions contains two different approaches for creating master objects.

  • AppExtensions.CreateMasterObject Method which creates master object, this method will create a master object from source object.
  • AppExtensions.CreateAndLinkMasterObject Method which creates and links master object, this method will create a master object and will convert the source object to linked object (linked to the created master object).

Example:

        private void CreateMyMasterObject(IApp app, string sourceId)

        {

            app.CreateAndLinkMasterObject(sourceId, null, new MasterObjectProperties

            {

                Metadata = new MasterObjectMetaData

                {

                    Name = "MyMasterObject",

                    Description = "My visualization"

                }

            });

        }

Regards,

Helene

5 Replies
Not applicable

Re: How to create a Master item in Qliksense using SDK?

Hi Prabhu,

Class AppExtensions contains two different approaches for creating master objects.

  • AppExtensions.CreateMasterObject Method which creates master object, this method will create a master object from source object.
  • AppExtensions.CreateAndLinkMasterObject Method which creates and links master object, this method will create a master object and will convert the source object to linked object (linked to the created master object).

Example:

        private void CreateMyMasterObject(IApp app, string sourceId)

        {

            app.CreateAndLinkMasterObject(sourceId, null, new MasterObjectProperties

            {

                Metadata = new MasterObjectMetaData

                {

                    Name = "MyMasterObject",

                    Description = "My visualization"

                }

            });

        }

Regards,

Helene

alexbjorlig
Contributor

Re: How to create a Master item in Qliksense using SDK?

Hi Helene.

What about a master measure/Dimension - how do you create this with the SDK?

Employee
Employee

Re: How to create a Master item in Qliksense using SDK?

Measures and dimensions are typically created by using the methods CreateMeasure and CreateDimension‌ that are available as extension methods for the IApp interface.

alexbjorlig
Contributor

Re: How to create a Master item in Qliksense using SDK?

I finally had success with creating my measures and dimensions, using exactly CreateMeasure and CreateDimension - thanks!

Employee
Employee

Re: How to create a Master item in Qliksense using SDK?

I tried to use this code to convert an existing chart to a master item however it keeps giving timeout errors. Any ideas? This is using version 3.2

var prop = new MasterObjectProperties()

    {

        MetaDef = new MetaAttributesDef

        {

            Title = "Sales chart",

            Description = "This chart show the total sales per region"

        }

    };

    App.CreateMasterObject("SalesPieChartID", "SalesMasterObjectID", prop);

Community Browser