Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Select and show in chart

Hi community,

I have list box of Variable A and chart with trending Variable A by months.

Who knows a trick how select tag from Variable A and show their own distributions by months.

Usually it's shown 100%.

Capture.PNG

Thanks,

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I did it.

Maybe it's not very easy way, but

if([Primary purpose of visit]='l',

Count({<[Primary purpose of visit]={'l'}>}TOTAL <MYear> [Primary purpose of visit]))/

count({<[Primary purpose of visit]=>} TOTAL <MYear> [Primary purpose of visit])

View solution in original post

13 Replies
Not applicable
Author

In the expressions tab you could add one new expression, just with the same formula used in the graph you have, but checking the option of 'relative':

With this, It will show the distribution by months. Then, you could use the conditional calculation of the expressions you have. On the first one, put getSelectedCount(variable A)<>1. On the new one, getSelectedCount(variable A)=1. This way, the graph will change the showed information depending on the selection you make.

Hope it helps

Anonymous
Not applicable
Author

Thank for reply.

But it didn't work. When I select any tag from Variable A, it calculates based on my selection. I get different results.

My expression:

Count({<[Variable A]={'a','b','c'}>}[Variable A])/

Count(TOTAL <MYear> [Variable A])

Other words,

when I select any tag from Variable A,

it should be shown only this tag distributions by months.

For example: tag a:Capture.PNG


Capture.PNG

Regards,

Not applicable
Author

Now I undestand what you are looking for. Your formula is ok, just have to add a set analysis to the TOTAL clause, not to be modified by the selection:

Count({<[Variable A]={'a','b','c'}>}[Variable A])/

Count({1}TOTAL <MYear> [Variable A])

Anonymous
Not applicable
Author

In this case It always shows all value, not modified by the selection.

It needs some tricks for it.

The idea is: when nothing selected, it shows all tags by months.

When I select any tag from Variable 2, it should be shown only this tag by months with the same %.

I don't know how to do, if I select tag from Variable A, use the same count, if I didn't select.

Because if I select the tag, it recalculates based on my selection count.

Thanks,

Not applicable
Author

My example does change on every selection:

a1.png

One value selected:

a2.png

Anonymous
Not applicable
Author

Could you send your example, please?

Not applicable
Author

I just used the formula that I posted:

Num(

     Count(EmployeeID)

     /Count({1}TOTAL<Year> EmployeeID)

, '#.###,00%')     //Just for formatting

In your case, EmployeeID=[Variable A] and Year=MYear. Please note that the {1} is only in the second Count expression.

Good Luck!

Anonymous
Not applicable
Author

Do you have only Year dimension?

Anonymous
Not applicable
Author

Please see my example.