ImportMatrix

Description

Import matrix XML to create a new matrix in the panel.

Signature
int ImportMatrix(string key, string panelId, string matrixXml)

Parameters

Name Data Type Description

key

string required

The authentication key

panelId

string required

The project id of the panel

matrixXml

string required

String with XML representing the matrix

Response

Data Type Description

int

Example

var communityPanelSoapClient = new CommunityPanelSoapClient();

var matrixXml = "<SamplingMatrix xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://schemas.confirmit.com/MatrixSchemaCollection/v1\"><IsValid>false</IsValid><Name>test</Name><VariantId>chrtest</VariantId><WeightIds><guid>a39830e2-99f1-4ff1-bde9-d5266ee1bb8a</guid></WeightIds><Dimensions><Dimension><Name>Dim1</Name><DimensionId>140fa42f-0e86-415a-9c6a-b4bc4c4aad26</DimensionId><ParentDimensionId>00000000-0000-0000-0000-000000000000</ParentDimensionId><ChildrenDimensionIds /><Type>Nominal</Type><Segments><Segment><Name>DateOfBirth</Name><SegmentId>0c19e221-f1a3-42b7-83a8-6cc9e13aca06</SegmentId><Expression>DATEBETWEEN(DateOfBirth, TODATE(\"1990-01-01\"), TODATE(\"2000-01-01\"))</Expression><Weights><SegmentWeight><Target>50</Target><WeightId>a39830e2-99f1-4ff1-bde9-d5266ee1bb8a</WeightId></SegmentWeight></Weights><ChildrenSegmentIds /></Segment><Segment><Name>DateOfBirth</Name><SegmentId>6128a3b5-e0cc-4329-89f0-343883987803</SegmentId><Expression>DATEBETWEEN(DateOfBirth, TODATE(\"1980-01-01\"), TODATE(\"1990-01-01\"))</Expression><Weights><SegmentWeight><Target>50</Target><WeightId>a39830e2-99f1-4ff1-bde9-d5266ee1bb8a</WeightId></SegmentWeight></Weights><ChildrenSegmentIds /></Segment></Segments></Dimension></Dimensions><WeightNames><WeightName>w1</WeightName></WeightNames></SamplingMatrix>";

var matrixId = communityPanelSoapClient.ImportMatrix(key, "p123456789", matrixXml);