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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
stevelord
Specialist
Specialist

text/expression in label works with one sum but not many sums

Hi, I have a bar chart and in the legend I want to include a sum in () to the right of the text labels.

When I have text followed by many sums, I get a null

When I have text followed by one sum, I get the desired text and sum

When I have many sums and no text, I get the desired total sum

This gives the null but I want a text and sum:

='Text '&SUM(field1+field2)

This gives text and a sum:

='Text '&SUM(field1)

This gives a sum:

=SUM(field1+field2)

Everything else is fine, for instance the bars in the bar graphs sum their fields okay, and I have sort descending based on a sum expression, just the label of the expression where I am incorporating a piece of text with the sums is fighting me.

Thanks!

PS> I tried summing in the script, but it's alot of concatenate loads and maybe the group by stuff has trouble- it looked like it ignored the fields I created with the sums and didn't error either.  I only need this particular expression for a couple of labels in one graph though, so should be fine if I can get it into the one graph.

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

you can try:

='text' & rangesum(sum([field1]), sum([field2]))

If this don't work, could you provide a sample qvw that demonstrates your problem?

Hope this helps!

View solution in original post

4 Replies
stevelord
Specialist
Specialist
Author

This one ignores me and gives a null too:

='text '&SUM([field1])+SUM([field2])

I'll try some numsums and such while I wait here, but everything looks like it populates okay without that elsewhere.

jerem1234
Specialist II
Specialist II

you can try:

='text' & rangesum(sum([field1]), sum([field2]))

If this don't work, could you provide a sample qvw that demonstrates your problem?

Hope this helps!

Anonymous
Not applicable

Hi Steve,

Have you tried adding a new expression and changing its display option to "values on data points" only?

stevelord
Specialist
Specialist
Author

rangesum nailed it, thanks!

Label is this:

='Email Aging Total ('&

Rangesum(

SUM([Email Aging Open]),

SUM([Email Aging In Progress]),

SUM([Email Aging Waiting on User]),

SUM([Email Aging Waiting on External]),

SUM([Email Aging Waiting on Internal]),

SUM([Email Aging Waiting on Tier 2]),

SUM([Email Aging Waiting on Director])

)

&')'

which looks like this on the legend: Email Aging Total (21)

Thanks again!

PS> This is the expression used for the bar itself.  I just had to replace the + with , and wrap it with the rangesum() when building it into the label.

=SUM([Email Aging Open])+

SUM([Email Aging In Progress])+

SUM([Email Aging Waiting on User])+

SUM([Email Aging Waiting on External])+

SUM([Email Aging Waiting on Internal])+

SUM([Email Aging Waiting on Tier 2])+

SUM([Email Aging Waiting on Director])

(I've found the legend is a nice place to put numbers if there's a lot happening or any small segments in the main part of the charts.)