Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with grouping lines in table

Hello,

I have issue with table object, my tables are related as follows in attached file and the problem is:

When I have Name(CustomerName), SalesId(Or InvoiceId) and CustInvoiceTrans.LineAmount column "CustInvoiceTrans.LineAmount" is showing values correctly, but I need that value to be summed after grouping by name(CustomerName) - I just remove salesId(or InvoiceId) column from table and my table become empty instead of showing summed lineAmount by Name.

Any suggestions?

Thank You in advance!

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Probably because InventBatchId has a single value per CustomerName/SalesID combination, but if you remove SalesID, every CustomerName will have many InventBatchId values and the IF() will fail (resulting in all NULL values)

Does it work if you change your expression into something like:

=SUM( IF ( InventBatchId LIKE 'bonus', CustInvoiceTrans.LineAmount))

View solution in original post

4 Replies
Not applicable
Author

Also i have this expression for LineAmount :

= if (InventBatchId like 'bonus', sum (CustInvoiceTrans.LineAmount))

mato32188
Specialist
Specialist

try to use aggr function...

example:

dimension: CustomerName

expression: sum(aggr(sum(CustInvoiceTrans.LineAmount), INVOICEID))

ECG line chart is the most important visualization in your life.
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Probably because InventBatchId has a single value per CustomerName/SalesID combination, but if you remove SalesID, every CustomerName will have many InventBatchId values and the IF() will fail (resulting in all NULL values)

Does it work if you change your expression into something like:

=SUM( IF ( InventBatchId LIKE 'bonus', CustInvoiceTrans.LineAmount))

Not applicable
Author

Thank You, I think that solve my problem