Qlik Community

Qlik Sense Deployment & Management

Discussion board where members learn more about Qlik Sense Installation, Deployment and Management.

zied_ahmed1
Contributor III

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
Esteemed Contributor

Re: problem with map title

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%')

)

45 Replies
gareth_wilson12
Contributor II

Re: problem with map title

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
Contributor III

Re: problem with map title

Hello,

Thanks you for your time,

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

Non.png

I need to have 100 % ...

gareth_wilson12
Contributor II

Re: problem with map title

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
Contributor III

Re: problem with map title

Hello,

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

non2.PNG

zied_ahmed1
Contributor III

Re: problem with map title

omarbensalemstalwar1‌ they could help us

omarbensalem
Esteemed Contributor

Re: problem with map title

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
Contributor III

Re: problem with map title

dep.PNG

omarbensalem
Esteemed Contributor

Re: problem with map title

what if u do not select a thing?

zied_ahmed1
Contributor III

Re: problem with map title

the result is 0