Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ryaneverts
Contributor II
Contributor II

Cycle Groups - Link dimension switching between two groups?

Hi all,

Running into a problem that hopefully the community can assist on. 

Premise is as follows:

  • I have a chart which uses a cycle group as a dimension
  • The cycle group consists of date fields at day, week, year/month, and fiscal year/quarter granularity
  • I want to limit the data displayed in the chart to last x days/weeks/months/quarters when no date range is selected to avoid needing a dimensional scroll bar.


We tried to resolve this by creating two cycle groups (one with limited date fields, one with non-limited date fields).  Using conditional logic, the limited group is shown until a date range is selected, and then the non-limited group is shown instead. We realized during testing that user experience would suffer when a date range is selected, as the two cycle groups aren't paired on which field is displayed.

My question: is there a way to pair two cycle groups so that shifting the displayed field in one cycle group will also shift the other, or do we need to try a different approach to the problem? 


It seems like the currently displayed field for the group must be stored as a hidden document variable, though I'm not confident it can be accessed/changed...

3 Replies
swuehl
MVP
MVP

If I understand correctly, you would like to have something like a SetCurrentField() function.

Unfortunately, I don't know a method to set the current field in a dimension group.

As an alternative approach, have you considered limiting your dimension values using set expressions?

Maybe you can use a variable to create dynamically a set expression based on your current selection.

ryaneverts
Contributor II
Contributor II
Author

Yeah, I was hoping for either a trigger I could set for OnFieldChange or something to that effect.

Sounds like you're thinking along the same lines we were, as either writing the reduction into the expression via Set analysis or using dimensional limits.

I've tried to do this with Dimensional limits previously with limited success, but I might take another crack at it to see if I can get the intended behavior, since we sometimes have several expressions per chart we might need to do this for.

amayuresh
Creator III
Creator III

if I understand your requirement correctly, try this,

=GetCurrentField(G1) will give you the Current Field Selected in G1 group.

You can use this function to check condition like below,

=if(GetCurrentField(G1)='Month', epression1,

if(GetCurrentField(G1)='Year',epression2,epression3))

Also this can help to compare two group field selection comparison as,

=if(GetCurrentField(G1)=GetCurrentField(G2),condition1,condition2)


to provide specific solution, can explain your requirement with example.