NETWORK.CLIQUES OpenBI
The network's cliques: groups where every node links to every other, the largest first.
Group: Networks. OpenBI’s own: DAX has no function of this name.
Syntax
NETWORK.CLIQUES ( <links>, <from>, <to> [, <smallest>] )
| Parameter | Type | Description |
|---|---|---|
links | Table | The rows that make the network, one link a row: a table of the model or a table expression, as the filters leave it. |
from | Expression evaluated for each row | One end of each row's link, such as a payer, a customer or a place. |
to | Expression evaluated for each row | The other end of each row's link. |
smallest | Whole number optional | The fewest nodes a clique must have: 2 or more, 3 when left out. |
Returns
Table. A row a node of each clique, the largest cliques first, with the columns Clique, Size and Node.
Remarks
- A clique is a group where every node is linked to every other. Only maximal ones are listed: no other node could join.
- The links are taken both ways. A node can belong to several cliques.
- At most 10,000 cliques are listed.
Compared with DAX
An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.
Examples
Groups where everyone knows everyone
EVALUATE
VAR Links =
DATATABLE (
"From", STRING, "To", STRING,
{
{ "Ann", "Bo" }, { "Ann", "Cy" }, { "Bo", "Cy" }, { "Cy", "Di" },
{ "Di", "Ed" }, { "Ed", "Fay" }, { "Di", "Fay" }, { "Fay", "Gus" }
}
)
RETURN
NETWORK.CLIQUES ( Links, [From], [To] )
| Clique | Size | Node |
|---|---|---|
| 1 | 3 | Bo |
| 1 | 3 | Ann |
| 1 | 3 | Cy |
| 2 | 3 | Ed |
| 2 | 3 | Di |
| 2 | 3 | Fay |
Down to pairs
With 2, a link in no triangle is a clique too.
EVALUATE
VAR Links =
DATATABLE (
"From", STRING, "To", STRING,
{
{ "Ann", "Bo" }, { "Ann", "Cy" }, { "Bo", "Cy" }, { "Cy", "Di" },
{ "Di", "Ed" }, { "Ed", "Fay" }, { "Di", "Fay" }, { "Fay", "Gus" }
}
)
RETURN
NETWORK.CLIQUES ( Links, [From], [To], 2 )
| Clique | Size | Node |
|---|---|---|
| 1 | 3 | Bo |
| 1 | 3 | Ann |
| 1 | 3 | Cy |
| 2 | 3 | Ed |
| 2 | 3 | Di |
| 2 | 3 | Fay |
| 3 | 2 | Gus |
| 3 | 2 | Fay |
| 4 | 2 | Cy |
| 4 | 2 | Di |
Related functions
NETWORK.COMMUNITIES, NETWORK.CYCLES, NETWORK.TRIADS.
Open Graph, OpenBI's graph library, does the work: maximal_cliques. See the OAX network functions and Open Graph.