Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
fashid
Specialist
Specialist

how do i disable selections on a text object expression

Hi,

I have a text object which shows the top performing branch.

Variables are used inside the expression which already have {1} for disabling selections but somehow they do not work on this object. !

My problem is that when i select a branch the top performer changes which is not desired

How do i get over this problem.

I have attached the sample app on which i am working.

Regards,

nadeem

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

No, take this out if it works without it.

Where I was thinking the {1} was required with the aggr is like this: avg({1}(aggr(sum{{1}Value), Dim)).  In your case the FirstSortedValue is the equivalent of the avg, and the sum is in your variables.

View solution in original post

8 Replies
Anonymous
Not applicable

Hi,

In your expression add Branch = for e.g. sum({<Branch =>} sales). This will not consider the selections made in the Branch field.

Regards,

Greeshma

fashid
Specialist
Specialist
Author

Its not a set analysis expression i am using variables for it and an if expression.

Also i tried to do the same in the variables but it did not work

Regards,

Nadeem

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

As a rule of thumb, putting {1} inside the aggregation will remove all selections.  That will negate the need for ignoring a single field.

You can add a {1} to both the FirstSortedValue and the Aggr, so this code should work for you:

=firstsortedvalue({1}BRANCH_NAME,-(aggr({1}RangeSum(

As it stands you will need to enter that into each part of the IF.  You can simplify that code a lot by adding the BranchFullName into the data model, using an ApplyMap and an INLINE table.  This way you can remove the massive IF.

Similarly, simplifications can be made, by removing the Aggr statements from the table (the Dimension does this for you) and rather than removing locations in the Dimension of your table (this messes up your selections) do this in the expression.

Hope that helps.

Steve

fashid
Specialist
Specialist
Author

hi,

thanks for replying.

i already put {1} inside my expressions variables.why do i need to put it outside .??

Regards

Nadeem

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

The variables are calculated inside the AGGR and the FirstSortedValue statements.  The scope of these therefore also need to be set to Entire Set, or the calculation of the variables will be in the subset.

When I was testing this out I noticed that the {1} inside the AGGR caused the syntax highlighting to go wrong.  This is a QlikBug and you should ignore the red underlining.

Steve

fashid
Specialist
Specialist
Author

Ok thanks for the explanation.

yeah same happened with me, so when i just used {1}  after the firstsorted , that did the job for me.

if(firstsortedvalue({1}BRANCH_NAME,.....

I did not have to use {1} after the aggr keyword.

What do you suggest , should i still use the {1} after the aggr.

Regards,

Nadeem

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

No, take this out if it works without it.

Where I was thinking the {1} was required with the aggr is like this: avg({1}(aggr(sum{{1}Value), Dim)).  In your case the FirstSortedValue is the equivalent of the avg, and the sum is in your variables.

fashid
Specialist
Specialist
Author

Perfectoo !!!!!!!!!!!!!

Many Many Thanks