# SelectPivotCells Method

## Overloads

| [SelectPivotCells(String, IEnumerable<NxSelectionCell>, Boolean, Boolean)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IGenericObject.SelectPivotCells.htm#Qlik_Engine_IGenericObject_SelectPivotCells_System_String_System_Collections_Generic_IEnumerable_Qlik_Engine_NxSelectionCell__System_Boolean_System_Boolean_) |  | Pivot table<br><br>Makes selections in the top or left dimension cells of a pivot table or in the data matrix. Only expanded dimensions can be selected.<br><br>Stacked table<br><br>Makes selections in the left dimension cells of a stacked table or in the data matrix.<br><br>The member **Change** returns the handles of the objects that are updated following the selections.<br><br><br>`qSuccess` is set to `true` if the selections are successful and is set to `false` in the following cases:<br><br>\* The object contains some invalid fields (fields that are not in the data model).<br><br>\* The selection applies to a locked field.<br><br>\* A range selection is performed and the parameter `OneAndOnlyOne` is set to true in the definition of the object. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IGenericObject.SelectPivotCells.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IGenericObject.SelectPivotCells.htm)

## SelectPivotCells(String, IEnumerable&lt;NxSelectionCell&gt;, Boolean, Boolean)

#### Pivot table

Makes selections in the top or left dimension cells of a pivot table or in the data matrix. Only expanded dimensions can be selected.

#### Stacked table

Makes selections in the left dimension cells of a stacked table or in the data matrix.

The member **Change** returns the handles of the objects that are updated following the selections.

`qSuccess` is set to `true` if the selections are successful and is set to `false` in the following cases:

* The object contains some invalid fields (fields that are not in the data model).
* The selection applies to a locked field.
* A range selection is performed and the parameter OneAndOnlyOne is set to true in the definition of the object.

### Declaration

```

          bool SelectPivotCells([QixName("qPath")] string path, [QixName("qSelections")] IEnumerable<NxSelectionCell> selections, [QixName("qSoftLock")] bool softLock = false, [QixName("qDeselectOnlyOneSelected")] bool deselectOnlyOneSelected = false)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | path | Path to the definition of the object.<br>For example, `/qHyperCubeDef` . |
| System.Collections.Generic.IEnumerable&lt;[NxSelectionCell](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.NxSelectionCell.htm)&gt; | selections | Information about the selections to perform. |
| System.Boolean | softLock | Set to true to ignore locks; in that case, locked fields can be selected. |
| System.Boolean | deselectOnlyOneSelected | Set this parameter to true to unselect the last single selected value. There must be only one selected value in the field.<br>The default value is false. |

### Returns

| Type | Description |
| --- | --- |
| System.Boolean |  |

### Remarks

This method only applies to hypercubes that are not represented as straight tables. The parameter `qMode` in `HyperCubeDef` must be set either to `P` or `K` .