Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Graph Selections

Is it possible to lock a graph from year selections being made?  I know I can get rid of the list box selection, but is it possible to lock down a graphy from a yearly selection?  The user wants the graph to remain static for all 3 years, and allow other non year selections to be made.  Here is the graph:

sales graph.png

Thank you,

Justin

15 Replies
Anonymous
Not applicable
Author

I am using a variable as follows:

if(not IsNull(R), RGB(R, G, B)) which ties to an inline statement I created.

Thank you,

Justin

sunny_talwar

You will need to share your Inline table as well as the variable. Is this inline table connected to the Year field somehow? Do you see activity in the values of R, G, B when you make a selection in the year field? Cause that is the only thing that could explain the changing colors.

HTH

Best,

S

Anonymous
Not applicable
Author

Here is both the inline table and variable:

LOAD * INLINE [

    YEAR, YEARSORT, R, G, B

    2014, 1, 0, 106, 182

    PLAN, 2, 169, 209, 92

    2013, 3, 111, 175, 215

];

Variable is vColor =

if(not IsNull(R), RGB(R, G, B))

I have the background color of the graph set to $(vColor).  When selections are made, without the year being locked down, the colors come back correctly.  2014 is a dark blue, plan a light green, and 2013 is a light blue.

Thanks again,

Justin

sunny_talwar

This is a workaround, but it solves your purpose. You can create another state and the list box for Year would be in a alternate state. Any selection made in the alternate state won't impact anything in your default state.

Note: But wherever you would want to use the expression which changes with the Year, you will have to make sure that it is associated with Alternate state's Year.

Second workaround is to create three expressions and no dimensions.

I am attaching a qvw in which I have tried to implement both methods for you. Please have a look and let me know what you think.

Best,

S

Anonymous
Not applicable
Author

Perfect,

Thank you for the help.  Although it will take longer, I believe setting up three expressions will work better as it is more simplistic.  Are their any benefits to using alternate states?  Seems like there would be more work on the back end outside of the charts.

Thanks,

Justin

sunny_talwar

Ya I think the best solution would be to create 3 expressions. Just like you said, it would be a hassle to make sure that all the Year selections are linked to the Alternate State for it to change.

Best,

S