Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
dunnalahk123
Creator III
Creator III

Sum Expression in QLikview

Hi,

can some one help me , how can I write sum of Numvalue for Distinct Customer ID

in below function , how can I add Distinct [Customer ID]

NUM(Sum({$<ScenarioLabel={'Actuals'}>}[NumValue]) ,'0.#;0.#' ))

Best Regards,

Hari

11 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

As a standalone expression? How would you like to visualise the list of results when more than one distinct Customer is active?

In a QlikView object, just add Customer as a Dimension and your expression to a Straight table, and QlikView will present only one sum per distinct Customer ID.

dunnalahk123
Creator III
Creator III
Author

Hi Peter,

In Chart table I have different KPI's where I have to use above expression.  For  rawdeatils yes I am using table box.

Best Regards,

HK

Peter_Cammaert
Partner - Champion III
Partner - Champion III

A table box doesn't accept expressions. You can only show (and format to a limited extnt) existing field values, nothing else.

In your Chart, is Customer ID a dimension? If not, then how do you want to present thje Sum() result when for example 100 distinct Cusotmer IDs are active?

PrashantSangle

can you explain sample app??

provide little bit more information.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
dunnalahk123
Creator III
Creator III
Author

Hi All,

Thank you every one.

I got it.

below is what I wrote

=Sum(DISTINCT{$<[Task ID] >} [NumValue])

Best Regards,

HK

Peter_Cammaert
Partner - Champion III
Partner - Champion III

This expression won't sum two identical copies of NumValue. Is that what you want, instead of producing sums for Distinct Customer IDs? Your results will be wrong if you sum for example two different invoices for the same customer and for the same amount...

dunnalahk123
Creator III
Creator III
Author

Hi Peter,

You are right, its not working as expected 😞

Best Regards,

PrashantSangle

try below

sum(Aggr(Distinct Sum({$<ScenarioLabel={'Actuals'}>}[NumValue]) ,Customer_ID))


Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
dunnalahk123
Creator III
Creator III
Author

HI

Basically I have  2 objects.

first object is having Numvalue , Task ID.

but when I join with second object in relationship with one to many.

Task ID is getting duplicated bec one task can have multiple subtasks.

but I write a calculation in my Chart expression I should write a expression where it should give me

sum value for Distinct Task ID's.

Best Regards,