Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

cyclic dimension in an expression - using GetCurrentField ?

Hi there,

I have this expression that gives me the share of a given dimension every month  :

=Sum(Volume) / Sum(TOTAL<Month> Volume)

Instead of displaying only [Month], I want to display a [Time Period] cyclic group that toggles between [Month] or [Cal. Quarter].

I have written an expression using GetCurrentField that displays the share according to what [time period] you select in the cyclic group, but it does not work :

=Sum(Volume) / Sum (TOTAL<(=GetCurrentField([Time period])> Volume))


Anybody has an idea of what i am doing wrong ?


Thank you,

Julien

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: cyclic dimension in an expression - using GetCurrentField ?

Try using a helper variable. See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
MVP & Luminary
MVP & Luminary

Re: cyclic dimension in an expression - using GetCurrentField ?

Try using a helper variable. See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

Partner
Partner

Re: cyclic dimension in an expression - using GetCurrentField ?

There is ")" misplaced and you need the "[]" brackets around the field in total for the [Cal. period] field. I tested the following expression in your document and it works:

=Sum(Volume) / Sum (TOTAL <[$(=GetCurrentField([Time period]))]> Volume)

Not applicable

Re: cyclic dimension in an expression - using GetCurrentField ?

Both solutions work actually! Thank you both !

Julien

Not applicable

Re: cyclic dimension in an expression - using GetCurrentField ?

Both solutions work actually! Thank you both !

Julien

Partner
Partner

Re: cyclic dimension in an expression - using GetCurrentField ?

You're welcome, I forgot to mention that the "$" was missing in your expression (dollar sign expansion).

Also could you mark an answer as a correct answer, it marks the question answered and will help others to find answers. Should you not know which one to mark as correct, please mark Gysbert's answer as correct, he was definitely first.