Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

GetObjectDimension for dynamic aggregation

Hello
I got a pivot table with several dimensions
I'm using the following GetObjectDimension(Dimensionality()-1) to know the name of the dimension at each row
how can I use this in an expression as dynamic aggregation:
avg(aggr(sum(), GetObjectDimension(Dimensionality()-1)))

it's not working as in the preview of the expression it's as follows:

ali_hijazi_0-1742900238163.png

 

I can walk on water when it freezes
Labels (3)
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

doesn't work

it evaluates to [GetObjectDimension(Dimensionality()-1]

 

but i tried this and it worked:

pick(wildmatch(GetObjectDimension(Dimensionality()-1)
,'Contract Type','Contract','act division','act department','act name','region','entity mgt','resource full name')
,$(vL.Rates.Denom.Group.By([Contract Type]))
,$(vL.Rates.Denom.Group.By([CNT]))
,$(vL.Rates.Denom.Group.By([ACT Division]))
,$(vL.Rates.Denom.Group.By([ACT Department]))
,$(vL.Rates.Denom.Group.By([ACT Name]))
,$(vL.Rates.Denom.Group.By([Region]))
,$(vL.Rates.Denom.Group.By([Entity MGT]))
,$(vL.Rates.Denom.Group.By([Resource Full Name]))

)

in the variable I pass the dimension to group by in Aggregation

I can walk on water when it freezes

View solution in original post

2 Replies
marcus_sommer
MVP
MVP

You may use:

[$(=GetObjectDimension(Dimensionality()-1))]

ali_hijazi
Partner - Master II
Partner - Master II
Author

doesn't work

it evaluates to [GetObjectDimension(Dimensionality()-1]

 

but i tried this and it worked:

pick(wildmatch(GetObjectDimension(Dimensionality()-1)
,'Contract Type','Contract','act division','act department','act name','region','entity mgt','resource full name')
,$(vL.Rates.Denom.Group.By([Contract Type]))
,$(vL.Rates.Denom.Group.By([CNT]))
,$(vL.Rates.Denom.Group.By([ACT Division]))
,$(vL.Rates.Denom.Group.By([ACT Department]))
,$(vL.Rates.Denom.Group.By([ACT Name]))
,$(vL.Rates.Denom.Group.By([Region]))
,$(vL.Rates.Denom.Group.By([Entity MGT]))
,$(vL.Rates.Denom.Group.By([Resource Full Name]))

)

in the variable I pass the dimension to group by in Aggregation

I can walk on water when it freezes