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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
SRSB
Partner - Contributor III
Partner - Contributor III

Problem with pourcentage by dimension on a Bar chart

Hello,

In a bar chart, I have a 2 dimensions

a  type which contains 2 valus and a dimendion of weeks which I modify as such:

=if( [VDate (Semaine)] > '$(vMaxSemaine_12)' and WeekName([VDate ]) <= '$(vMaxSemaine_1)',
if(len([VDate (Semaine)])=1, 'S0'&[Vente Date (Semaine)],'S'&[Vente Date (Semaine)]))

Then I have an indicator to calculate the %

(Count ( distinct {< [VDate (année)]={$(=vMaxAnneeVente )} >} [ID_BON] )
- Count ( distinct {<[ [VDate (année)]={$(=vMaxAnneeVente )}>} [ID BON] )
 )
/ (Count ( distinct {<[FL_Vente] ={1} , [VDate (année)]={$(=vMaxAnneeVente )} >} total <[VDate (Semaine)]> [ID BON] )
- Count ( distinct {< [VDate (année)]={$(=vMaxAnneeVente )}>} total <[VDate (Semaine)]> [ID BON] )

The variable vMaxSemaine_12 = =weekname(max([VDate]), -12)

The problem is that the pourcentage is divided on the total of weeks and not by week

ssahar_0-1637254975844.png

the desired result is as such: 

 

ssahar_1-1637255000100.png

Can you give some advice please. 

 

Thanks.

 

 

2 Replies
paulcalvet
Specialist
Specialist

Hello,

You should use TOTAL function in your denominator.

Maybe like this count(distinct [ID BS (Souscription)] )/count(TOTAL [ID BS (Souscription)] ) 

or 

count(distinct [ID BS (Souscription)] )/count(TOTAL<Semaine> [ID BS (Souscription)] ) 

Regards,

SRSB
Partner - Contributor III
Partner - Contributor III
Author

Hello,

thanks for your reply, I'm already using TOTAL <[VDate (semaine)]> but it does not work.

Regards,