Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using the cyclic dimension in an aggr statement (GetCurrentField)

I have a chart that has a cyclic dimension. The measure (Y axis) has an aggrregate statement as follows :

aggr(sum(Data) ,Type, GetCurrentField([FisMo / Qtr]) )

([FisMo / Qtr]   this is the cyclic dimension - it selects either fiscal month or fiscal quarter.

When I switch between fiscal month and fiscal quarter on the dimension using the cyce button, I need to change the aggr statement to reflect that. Thus I use "GetCurrentField([FisMo / Qtr])" ( in place of  Fiscal Month and Fiscal Qtr.)

Although GetCurrentField([FisMo / Qtr]) works everywhere in Qlikview ( in a text box for example )  to show the current dimension cycle, it will NOT work when placed in the aggr statement. The chart stops calculating as soon as I insert "GetCurrentField([FisMo / Qtr])" in place of the fiscal month or fiscal quarter.

Does anyone have a workaround for this?

Thank,

Jim

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try aggr(sum(Data) ,Type, $(=GetCurrentField([FisMo / Qtr])) )


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Try aggr(sum(Data) ,Type, $(=GetCurrentField([FisMo / Qtr])) )


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert  - You are the master - it works - a big thank you.

The folks on this community are great!

My only regret is not asking sooner - I spent over an hour on this last night.

Jim

prodanov
Partner - Creator
Partner - Creator

You haven't to use this function. Try only with name of group - aggr(sum(Data) ,Type, [FisMo / Qtr])

raynac
Partner - Creator
Partner - Creator

This is so strange...I tried this with a cycle  of Year, Month, Day, W/E and DOW...it looked amazing and I had thought it was working but as I cycled through, the first three worked like a charm and the W/E and DOW were blank.