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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I combine this data in the script?

I have a horrible database that has a lot of examples of the follow:

Payment ID: 1 Account Number: 12345 Payment Date: 1/1/2009 Payment Amount: 50

Payment ID: 2 Account Number: 12345 Payment Date: 1/1/2009 Payment Amount: 100

I want to combine these two (or three or four or five) into one, so this one should be:

Payment ID: 1 Account Number: 12345 Payment Date: 1/1/2009 Payment Amount: 150

I'm really just learning how to use the script and I really don't have a clue how to fix this.

Thanks in advance.

2 Replies
bumin
Partner - Creator II
Partner - Creator II

what about if you create a pivot table with the dimensions aPayment ID, Account-No and Payment date and create a formula as sum(Amount)?

Within the script you use the SQL

select paymentID, AccountNo, paymentdate, sum(amount) from table

group by paymentID, AccountNo, paymentdate

maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi,

You can try the following scripts,

select min("Payment ID") as "Payment ID", sum(Amount) as Amount, "Account Number","Payment Date"

from TableName group by "Account Number", "Payment Date"

Good LuckSmile