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: 
merlephil
Contributor II
Contributor II

Alternative to aggr(only( with multiple selections

Updated the code, removed only thinking this would allow multiselect. Unfortunately my dimension has only one result when I make a selection on OG_libelle_operation.

=aggr({1<
TOG_thematique=-{'ASSISTANCE AD'}
, numAnnee={$(=$(numAnnee$))}
, [perimetre_per.per_libelle]={"$(=if(getselectedcount([perimetre_per.per_libelle])=0,'Global',replace(GetFieldSelections([perimetre_per.per_libelle]),', ','","')))"}
, TOG_famille=P(TOG_famille)
, TOG_thematique=P(TOG_thematique)
, [etablissement_etab.etab_type]=P([etablissement_etab.etab_type])
, [Type Budget]=P([Type Budget])
, FME_niveau_priorite=P(FME_niveau_priorite)
, cc_etat_avancement=P(cc_etat_avancement)
, plan_action_libelle=P(plan_action_libelle)
, OG_client=P(OG_client)
, OG_libelle_operation=P(OG_libelle_operation)
>}OG_libelle_operation,OG_libelle_operation)

My customer wants to do multiple selections on the field OG_libelle_operation. I must keep AGGR and set analysis elements shown above. Have somebody got a workaround ?

Labels (1)
5 Replies
marcus_sommer

I wouldn't use a calculated dimension else using the origin field and applying the needed filters within the chart-expressions.

Beside this many of the conditions aren't needed because something like:

TOG_famille={"$(=if(getselectedcount(TOG_famille)=0,'*',replace(getfieldSelections(TOG_famille),', ','","')))"}

means that the made or not made selections of this field are considered - therefore this condition is superfluous.

In cases in which the selection-state of a field needs to be queried it's usually easier to use the appropriate features of p() and e(), like:

TOG_famille = p(TOG_famille)

- Marcus

merlephil
Contributor II
Contributor II
Author

The thing is it is not used in a chart but multiple tables and filters in the app and is meant to work in the same way. I reviewed the conditions as per your suggestions but my problem remains. Aggr if I make no mistake is to build up a list from the values of a field. It should allow muti-selecting items in that list in a way or another. When I try multiselecting, QlikSense throws a "Invalid parameters" error.

marcus_sommer

It's not really clear for me what you are trying to do and what the issue is. I think the conditions aren't essentially in regard to your aim of multi-selecting and therefore we could skip them at this point. So simplified we have:

aggr(Field, Field)

as dimension or is it different in your use-case?

- Marcus

merlephil
Contributor II
Contributor II
Author

merlephil_0-1655194429639.png

Above is the behavior I have when I make a selection on the filter. Without selection I have multiple options in that filter.
I seek out to show on that filter every record of OG_libelle_operation excluding one value for TOG_thematique for a defined perimeter and a defined Year. The dimension shows awaited results but is incorrect after selecting, because once an option of OG_libelle_operation is chosen you just can't select a second one. My goad is to be able to select as many OG_libelle_operation in the list made by the aggr function.
Hope my explaination's clearer.

marcus_sommer

In QlikView it displayed the excluded values also with:

aggr(only({1} Field), Field)

- Marcus