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

select dynamic input for a graph

Hello All,

I have a table containing transaction data for multiple quarters (which can be identified by a transaction date associate with it). I want to create a graph comparing any 2 quarters in the data but I want to give user a choice to select the quarters to compare may be using radio buttons. How do I go about this? I couldn't find an example which will help me to implement such a functionality.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Does this look like something you are trying to do? (PFA)

Best,

Sunny

View solution in original post

16 Replies
sunny_talwar

What would be the dimension you would be comparing them on? is it going to be quarter or some other dimension like country, state, etc..

Best,

Sunny

Not applicable
Author

my dimension will be product ID and one of the graphs will be comparing the sales per quarter another will be change in price.

sunny_talwar

You can try to employ the concept of alternate states. Take a peek at the attached sample.

Best,

Sunny

buzzy996
Master II
Master II

try this way,sample attached.

u have to create 2 variables,

List box: Variable1--define listed values in list box(in ur case Q1,Q2,Q3,Q4)

List box: Variable2--define listed values in list box(in ur case Q1,Q2,Q3,Q4) (SAME VALUES)


use those variables in ur expressions,to render dynamic values from ur selections

Not applicable
Author

Hi Siva,

thanks for this example, it is very close to what I want. Defining 2 variables and using them to change the input is something I was looking for! Now, I am trying a plot a graph for change in mVal by pVal as seen in attached example. i had the exact same graph before I started implementing the dynamic selection but for some reason I couldn't get this to work using the dynamic drop down for quarter selection. Any thoughts?

sunny_talwar

Does this look like something you are trying to do? (PFA)

Best,

Sunny

buzzy996
Master II
Master II

see attached and let us know,if u need any changes..,the problem with  expression,i just replaced sunny exp here.

Not applicable
Author

Edi: NVM it worked!

Hi Sunny,

This worked perfectly! Now one more question for the calculated dimension -

=Sum({<Quarter = {'$(vQuarter1)'}>}MValue) - Sum({<Quarter = {'$(vQuarter2)'}>}MValue)

For the above expression can I add one more set expression (Year) as follows:

=Sum({<Quarter = {'$(vYear1)'}>}{<Quarter = {'$(vQuarter1)'}>}MValue) - Sum({<Quarter = {'$(vYear2)'}>}{<Quarter = {'$(vQuarter2)'}>}MValue)

sunny_talwar

How can Quarter be equal to year? What exactly are you trying to do? Would you be able to give an example?