Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
CHRIS_Singa
Contributor III
Contributor III

Cyclic dimension with aggr() function

Hello

Hope you are fine 

Can someone show me how I can use cyclic dimension with aggr() funciton ? 

2 Examples for my question :

Exemple 1 : with set analysis

Exemple 2 : with aggr() function

Thank you in advance for the return

1 Solution

Accepted Solutions
marcus_sommer

The above mentioned is independent to the fact if it's a single dimension or a part of a dimension-group.

I don't know if the cloud-versions provide any dimension-groups but if not I doubt that it could be emulated. Possible instead would be to to control the shown dimensions from the outside, for example with the selections from an island-table, like:

Dim: load pick(recno(), 'Product', 'Country', 'YearMonth') as Dim autogenerate 3;

and the dimension is then grabbing the selected value, like:

[$(=maxstring(Dim))]

View solution in original post

3 Replies
marcus_sommer

Set analysis could be only applied within aggregation-function which are not applicable as calculated dimension - unless they is wrapped with aggr(). Such approach may look like:

aggr(only({< Year = {"$(=max(Year))"}>} Product), Product)

to return for example only products for the max. respectively selected year.

Compared with native fields from the data-model have calculated dimensions a lot of disadvantages. Therefore they should be only used if it's not possible/practicable to use native fields and the conditions are not transferrable to the expressions.

In regard to the above example you could apply the native field Product as dimension and using the set analysis within the measure like:

sum({< Year = {"$(=max(Year))"}>} Amount)

CHRIS_Singa
Contributor III
Contributor III
Author

@marcus_sommer 

Imagine your dimension is cyclic (New possibility in Cloud)

How can we replace the product dimension with a cyclic dimension ?

marcus_sommer

The above mentioned is independent to the fact if it's a single dimension or a part of a dimension-group.

I don't know if the cloud-versions provide any dimension-groups but if not I doubt that it could be emulated. Possible instead would be to to control the shown dimensions from the outside, for example with the selections from an island-table, like:

Dim: load pick(recno(), 'Product', 'Country', 'YearMonth') as Dim autogenerate 3;

and the dimension is then grabbing the selected value, like:

[$(=maxstring(Dim))]