Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

Concatenante dim and measure in a chart (pie chart)

Hi everyone ( stalwar1‌),

I have a pie chart,

as a dimension: Sens

as a measure: Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier)

here is the current output  :


Capture.PNG

Now, what I'm trying to do is having next to N->S and S->N the % of the total.

I'll then need to alter my dimension and add to it a measure :

Sens&' / '&

($(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier))

/

$(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier)))


But this is always showing 1:


Capture.PNG

The reason for this is because the first part always returns the total and doesn't aggregate on the dimension SENS:

See: when I choose as a dimension:

Sens&' / '&

$(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier))

It will show 121, which is the total:(32+89)

Capture.PNG

The question is, how to force this o return 89 for Sens N-S and 32 for S-N?

I also tried this:

=Sens&' / '&

Aggr($(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier)),Sens)

But this did not change a thing !

Thanks in advance for your help

1 Solution

Accepted Solutions
sunny_talwar

You love $ sign expansion.... don't you? Did my above expression use dollar sign expansion? Can you at least give it a shot

Aggr(


Sens&' / '&

(Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier)

/

Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier))


, Sens)

Please note the missing dollar sign expansion

View solution in original post

6 Replies
sunny_talwar

Is there a reason your use dollar sign expansion? May be this is something related to Qlik Sense, but in QlikView, I would do like this

Sens&' / '&

(Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier)

/

Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier))

OmarBenSalem
Author

That's exactly what I've done sunny, and It keeps on returning 1; because the first part always returns the total.

Sens&' / '&

($(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier))

/

$(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier)))


For the $ part, Yes, in Qlik Sense, we have to call a measure with a dollar sign to use as a dimension.

If we don't write the $, it will be invalid

sunny_talwar

That can't be true.... can you try this:

Aggr(


Sens&' / '&

(Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier)

/

Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier))


, Sens)

OmarBenSalem
Author

Here's my expression:

=Aggr( Sens&' / '&

($(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier))

/

$(=Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier))),Sens)

Here is the result :

Capture.PNG

That's really odd..

sunny_talwar

You love $ sign expansion.... don't you? Did my above expression use dollar sign expansion? Can you at least give it a shot

Aggr(


Sens&' / '&

(Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}Dossier)

/

Count({<$(vSetPeriodPres),Code_Ligne={'MAL'},Groupe_Complet_Vide={c,C,G}>}TOTAL Dossier))


, Sens)

Please note the missing dollar sign expansion

OmarBenSalem
Author

Haha; Yes It works now !

My bad Sunny