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

expression depending on selection

Hi,

I have a dashboard with two expressions and I need to show one expression or the other depending on the selector.

Is it possible?

Thanks,

David

1 Solution

Accepted Solutions
Not applicable
Author

Of course. Are you making a selection in a field?

If(Only(SelectorField)="Value1", Sum(Expression1), Sum(Expression2))


There are many ways to do it. Using variables is good, because then everything comes from one place.

View solution in original post

6 Replies
Not applicable
Author

Of course. Are you making a selection in a field?

If(Only(SelectorField)="Value1", Sum(Expression1), Sum(Expression2))


There are many ways to do it. Using variables is good, because then everything comes from one place.

Not applicable
Author

Hello,

There are two selectors, it doesn't depends on the value of the selector, only depends on the selector I use

Anonymous
Not applicable
Author

if (getfieldselections ( field name ) , sum ( expression1 ) , sum (expression2 ) )

Not applicable
Author

What do you mean by what selector? You mean there are two fields and you're only making a selection on one? Could you give an example?

Not applicable
Author

thanks,

Both answers work perfectly

Not applicable
Author

And without selecting the field, can I link it with another field in the layout?

ex: I have week and week2, some values are linked with week and others with week2 I need to unify this two fields,

I've tried to do it in the script calling both fields week but when I load a message of circular fields appears (I don't know why),

any idea?

Thanks,

David