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

Changing chart static 'max' on axes depending on cyclic group

Hi all,

I have a cyclic group - cycling between week and month for some call data.

I want to create a static y-axis, but the max needs to be different based on what cyclic group dimension is currently showing.

Can anyone suggest how I interrogate a cyclic group dimension within an expression?

for example, logically:

If cyclic group selection is 'Weekstart(DATE)' then static max = 100

else if cyclic group selection is 'Monthname(DATE)' then static max = 500

many thanks,

Matt

1 Solution

Accepted Solutions
sudeepkm
Specialist III
Specialist III

Please try this.

The value of getCurrentField(GroupName) does not return the label instead it returns the expression used.

T128192_1.png

View solution in original post

8 Replies
senarath
Creator III
Creator III

Hi,

According to my understanding, Static Min/Max can be set for expressions.If you want it to be difference for different dimensions, you may have to create two charts for two dimensions (one for month and one for week) and apply a conditional show by creating a variable.

Anyway let's wait a moment as there could be an expert idea for your matter.

Thanx

sudeepkm
Specialist III
Specialist III

yes it is possible. Please take a look at the example.

You can set the max or min based on if(GetCurrentField(grp)='Week',50,if(GetCurrentField(grp)='Month',100))

avinashelite

Hi Matthew,

Use getselectedfield(groupname) and set the max of axis

Not applicable
Author

Hi Sudeep - this looks like JUST the thing I need.

however, applying it to my example (see attached)  it does not seem to work.

any ideas?

I have checked the group name and the dimension labels and everything seems ok...

scratching my head.

avinashelite

Hi,

See the attachment for the solution.

sudeepkm
Specialist III
Specialist III

Please try this.

The value of getCurrentField(GroupName) does not return the label instead it returns the expression used.

T128192_1.png

avinashelite

Hi Matthew,

Problem is in the group your using expression so it not taking the name in the condition.

If you need the name comparison do it at the script level. If not follow the solution provided in the last attachment.

Regards,

@vi

Not applicable
Author

Thank you both for your input.

Works perfectly!!