OpenBI Docs Buy

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>] )
ParameterTypeDescription
linksTableThe rows that make the network, one link a row: a table of the model or a table expression, as the filters leave it.
fromExpression
evaluated for each row
One end of each row's link, such as a payer, a customer or a place.
toExpression
evaluated for each row
The other end of each row's link.
smallestWhole 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] )
CliqueSizeNode
13Bo
13Ann
13Cy
23Ed
23Di
23Fay

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 )
CliqueSizeNode
13Bo
13Ann
13Cy
23Ed
23Di
23Fay
32Gus
32Fay
42Cy
42Di

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.

Last updated · OpenBI Studio 0.3.78