Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If only one value available, force its selection

Hi,

I have Section Access on a field which restricts some people to 1 value. If those people open on the dashboard I'd like to have this value autoselected in the field and stay selected for their session.

I know that if there's only one possible value, selecting it should not matter. But it does in my setup as it defines the consolidation level of my financial figures.

7 Replies
maxgro
MVP
MVP

try with 2 actions (at the sheet level, in trigger tab or at the document level, on open but maybe it doesn't work in ajax)

- select in field

yourfield

=yourfield

- lock field

yourfield

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In your logic that defines the consolidation, can you change from using GetSelectedCount()=1 to GetPossibleCount()=1?

-Rob

Not applicable
Author

Hi Massimo,

onActivateSheet does not work in AJAX

I struggled to have a dynamic "select in field" for users who are not restricted, they should not have any value forced on them. So I came with OnAnySelect trigger

=if(count({1} distinct Field)=1,Field,GetFieldSelections(Field))

And a conditional Lock Field trigger as well since I don't want to lock for all access users.

That seems to work for me. Thanks for the suggestions of lock field.

Rob, I'm nog using any of the constructs.

maxgro
MVP
MVP

are you sure?

I tried with a small .qvw and for me it works (on ActivateSheet)

Server version 11.20.12235.0

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you are not using GetSelectedCount or GetPossibleCount, then why does it matter if a single possible value is selected or not?

-Rob

Not applicable
Author

It's like this: I have Turnover on consolidated group level, on country level, on entity level.

So I tag all my lines I read in with their level and I have a variable that checks the lowest selected grain and turns it into a level indicator (group, country of entity). So if they select a country, I show the country level lines. If they select nothing, I show consolidated group figures. The difficulty is that 2+2 is not 4 but more like 3,5 so I just read all those lines from SAP BPC and don't use the QV engine.

Now due to section access on country all lines for group level are deleted from the dataset (as they don't have a country) BUT as long as the users don't select a country, the level variable remains 'group' and thus empty gauges as a cause. So they have to select their own and only country to see country level lines.

I don't know if that's clear but it works as desired.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What is the expression that sets the level indicator variable?

-Rob