Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

piechart both expression and number

Hey

i have an expression say sum({<empid={1}>}empid)/sum(empid)

i want this 2 be dispayd as % in pie chart and sum(empid) as number values in the same pie chrt.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

thanks gysbert.

In  dual(num(sum(Sales),'#,##0') & chr(10) & num(sum({<Year={2009}>}Sales)/sum(Sales),'#.0%') ,sum({<Year={2009}>}Sales)/sum(Sales))

what does num(sum(Sales),'#,##0') & chr(10)  actually mean? and y u r concatinating this with num(sum({<Year={2009}>}Sales)/sum(Sales),'#.0%')  ?

pls elaborate this.

Gysbert_Wassenaar

The chr(10) is a line break. That way you get the first part of the text on one line and the second part on the next line.


talk is cheap, supply exceeds demand
Not applicable
Author

gwassenaar dual takes two parameters text and number.

so you say num(sum(Sales),'#,##0') & chr(10) & num(sum({<Year={2009}>}Sales)/sum(Sales),'#.0%')  is a textual representation and sum({<Year={2009}>}Sales)/sum(Sales)  is a numerical representation ?

Gysbert_Wassenaar

Yes, that's correct.


talk is cheap, supply exceeds demand
Not applicable
Author

num(sum(Sales),'#,##0') & chr(10)

it means the number displayed in pie chart is sum(Sales) and not sum({<Year={2009}>}Sales)/sum(Sales)?

because after line break; (sales in 2009 / total sales) is present;which is displaying as %. Before line break; the expression is num(sum(Sales),'#,##0') -> the number display part which is not the ratio. gwassenaar

Gysbert_Wassenaar

num(sum(Sales),'#,##0') & chr(10)

it means the number displayed in pie chart is sum(Sales) and not sum({<Year={2009}>}Sales)/sum(Sales)?

No, that's not correct. The dual function creates numeric value that also has a textual display representation. The numeric values determine the sizes of the pie segments. The textual representations (two lines of text because of the chr(10)) are shown as a labels with the segments.


talk is cheap, supply exceeds demand
Not applicable
Author

then wat does exactly num(sum(Sales),'#,##0') mean to be used? gwassenaar