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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

use Sum field twice

I have a dashboard with multiple sheets and I have one very important field "Call_time" which I am using for SUM in every sheet on different charts. but ive noticed If I use that field for sum in one chart and if i try to use the same field in other charts it says.

"You have attempted to apply a numerical expression, which is not uniquely defined for the specified variable.
In order to use this variable in expressions relying on number of occurrences, please read it a second time under a new name from its primary table."

Please suggest the best way to use the same field in every chart for sum or avg purpose.

3 Replies
Not applicable
Author

can you upload sample document

-Raghu.

Anonymous
Not applicable
Author

Apparently the problem is not that you're using a field on the multiple sheets, but is that you're using a key field in the expressions. Key field is a field that exists in more than one logical table, and links these tables. In general, it is not a good idea to use it in expressions, although sometimes it may work.
To resolve the problem, create a duplicate of this field in your script:
LOAD
Call_time,
Call_time as Ct // for example
...
And, in expression use sum(Ct) instead of sum(Call_time)

wizardo
Creator III
Creator III

Michael is absolutly right, one remark tho,

when you make a duplicate of the field in tbale A and use it in all the expressions, it will only SUM the records in table A.

but since this field is in the key, it means it exists on other tables too.

you can duplicate them in other tables too, but if you need to SUM records from more then one table, then you would also have to make a seperate key to connect just these two tables (one new link for every new combination you would need in your layout).

there might be an easier way to do it in the layout but i havent given enough thoughts in that directon yet