Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nedcliqs
Contributor III
Contributor III

Sum a range of Accounts

  Hi Community,

Please help with a simple formula to Sum a range of Account numbers as follows:

1. Sum Amount for the Accounts 5722  to 5728  ( I want to state a range NOT to list them all)

2. Sum Amount for the range of Accounts 2300 to 2480

3. Then Subtract (2.) from (1.)

Below is just a sample , the Accounts are way too many than this hence the reason why i cant use a formula such as

WHERE Acc IN (5722, 5722.........)

AccAmount
57226000
5723850
57246850
57257700
572614550
572722250
572836800
34699625
230014300
23306400
23607900
23904500
24203400
24501100
24802300
1 Solution

Accepted Solutions
Anonymous
Not applicable

If account is numeric you could try

sum({<Account={'>=2300<=2480'}>}Amount) - sum({<Account={'>=5722<=5728'}>}Amount)

View solution in original post

5 Replies
Anonymous
Not applicable

If account is numeric you could try

sum({<Account={'>=2300<=2480'}>}Amount) - sum({<Account={'>=5722<=5728'}>}Amount)

Miguel_Angel_Baeyens

That syntax with double quotes as long as it is a search, single quotes work, but it's a known bug.

nedcliqs
Contributor III
Contributor III
Author

Thanks @Wallo Atkinson, this worked correctly on my sample data.

I will apply then apply the formula on the model and see how it goes.

Once again, thank you

Anonymous
Not applicable

Good luck.  Hope it helps.

nedcliqs
Contributor III
Contributor III
Author

Hi atkinsow‌, i applied the formula on my model. It worked like charm!

Thank you very much for helping here!