Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

problem with map title

Hello I have this map and i would like when i select one or N department i have the % of the Docs:

I used this but it doesn't work :

=If(GetSelectedCount([DepartementsFR.Name])=0,'',[DepartementsFR.Name]&' : '&

Num(Count({<[DepartementsFR.Name]={"$(=Only([DepartementsFR.Name]))"}>}Docs)/Count(ALL Docs),'###0,00%'))

%_1.PNG

%2.PNG

1 Solution

Accepted Solutions
OmarBenSalem

Try this:

count(total{<[DepartementsFR.Name]=p({<[DepartementsFR.Name]>}[DepartementsFR.Name])>} Docs)

and then :

=If(GetSelectedCount([DepartementsFR.Name])=0,'',

GetFieldSelections([DepartementsFR.Name])&' : '& Num(Count(Docs)/

count(total{<[DepartementsFR.Name]=p({<[DepartementsFR.Name]>}[DepartementsFR.Name])>} Docs)

,'###0,00%')

)

View solution in original post

45 Replies
Anonymous
Not applicable

I don't understand the additional ONLY statement when working out the percentage, you need the calculation to work against selected departments which would just be a standard Count(Docs) statement.

To get all selected values in the title you can use the GetFieldSelections() function.

Take a look expression below and example attached;

=If(GetSelectedCount([DepartementsFR.Name])=0,'',GetFieldSelections([DepartementsFR.Name])&' : '&

Num(Count(Docs)/Count(ALL Docs),'###0,00%'))

zied_ahmed1
Specialist
Specialist
Author

Hello,

Thanks you for your time,

The problem is when i select all departments i have this :

Non.png

I need to have 100 % ...

Anonymous
Not applicable

I would take a look at the underlying data, are there Docs without a DepartmentFR.Name?

Try changing your ALL to TOTAL, this should ensure all Docs without a department are not taken into account;

=If(GetSelectedCount([DepartementsFR.Name])=0,'',GetFieldSelections([DepartementsFR.Name])&' : '&

Num(Count(Docs)/Count(TOTAL Docs),'###0,00%'))

zied_ahmed1
Specialist
Specialist
Author

Hello,

I tried this me too but it doesn't work,it display 100%.

non2.PNG

zied_ahmed1
Specialist
Specialist
Author

omarbensalemstalwar1‌ they could help us

OmarBenSalem

create a text object; put as a measure:

GetSelectedCount([DepartementsFR.Name])


do not select anything, see what it shows;

then select :

one or 2 departements and see what it shows;


let this be our first test

zied_ahmed1
Specialist
Specialist
Author

dep.PNG

OmarBenSalem

what if u do not select a thing?

zied_ahmed1
Specialist
Specialist
Author

the result is 0