Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhuappu
Creator II
Creator 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

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

View solution in original post

5 Replies
Not applicable

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
Creator
Creator

Hi Helene.

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

Øystein_Kolsrud
Employee
Employee

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

alexbjorlig
Creator
Creator

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

nak
Employee
Employee

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);