Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Gysbert_Wassenaar

Try using a helper variable. See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

Try using a helper variable. See attached qvw


talk is cheap, supply exceeds demand
stigchel
Partner - Master
Partner - Master

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
Author

Both solutions work actually! Thank you both !

Julien

Not applicable
Author

Both solutions work actually! Thank you both !

Julien

stigchel
Partner - Master
Partner - Master

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.

cspindley
Contributor III
Contributor III

ty Gysbert, Clive