IBM Support

What is a tuple?

Troubleshooting


Problem

This document describes what a tuple is and how the tuple function works in query specifications.

Resolving The Problem

The tuple function serves to specify the specific context that a filter, sort order or another function (such as value() or rank()) will operate against. A tuple indicates which coordinates of the cube are in use for the operation being executed.

Here are some examples of the tuple function being used...

Within a Query Expression that filters:

Simple use case:

The tuple function serves to specify the specific context that a filter will operate against. In the case of a filter such as ?Top 10 SalesPeople for Q1 of 2012?, the context would likely be the measure (e.g. revenue) and the member 2012 Q1.

Syntax:

TopCount( children of salespeople, 10, tuple([Revenue], [2012 Q1]) )

If a dimension is not represented in the tuple function for a filter, then the default member of each dimension is used for the context.


Within a Query Expression using the Rank function:

Syntax:

rank(<measure> <ordinal direction> TUPLE <member being ranked> WITHIN SET <visible members on opposite axis>)


Simple use case:

User wants to see the rank of each Product Line for the year 2012.

rank(currentMeasure DESC tuple [2012] WITHIN SET [Product Line])

NOTE: In this case, the context used by tuple is not placed in brackets.

[{"Product":{"code":"SSEP7J","label":"Cognos Business Intelligence"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Report Studio","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.2.2;10.2.1;10.2","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

1019080

Document Information

Modified date:
15 June 2018

UID

swg21339536