Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sweens78
Creator
Creator

Subtrating 2 formulas

Hi Guys I've two formulas below I want to subtract 1 from the other but I think I'm getting the brackets wrong hence wrong answer?

Any ideas of what I might be doing wrong?

Formula 1

count({<NOK_Carer_ID={2}>} NEWKEYID)-count({<NOK_Carer_ID={2}>} PatientsNotAssessed_ID)+count({<NOK_Carer_ID={1}>} NEWKEYID)-count({<NOK_Carer_ID={1}>} PatientsNotAssessed_ID)

Formula 2

count({<NOK_Carer_ID={3}>} NEWKEYID)-count({<NOK_Carer_ID={3}>} PatientsNotAssessed_ID)+count({<NOK_Carer_ID={4}>} NEWKEYID)-count({<NOK_Carer_ID={4}>} PatientsNotAssessed_ID)

Trying to Subtract?

count({<NOK_Carer_ID={2}>} NEWKEYID)-count({<NOK_Carer_ID={2}>} PatientsNotAssessed_ID)+count({<NOK_Carer_ID={1}>} NEWKEYID)-count({<NOK_Carer_ID={1}>} PatientsNotAssessed_ID) -count({<NOK_Carer_ID={3}>} NEWKEYID)-count({<NOK_Carer_ID={3}>} PatientsNotAssessed_ID)+count({<NOK_Carer_ID={4}>} NEWKEYID)-count({<NOK_Carer_ID={4}>} PatientsNotAssessed_ID)

1 Solution

Accepted Solutions
Anonymous
Not applicable

use additional brackets around each formula

(formula1) - (formula2)

View solution in original post

4 Replies
Anonymous
Not applicable

use additional brackets around each formula

(formula1) - (formula2)

sweens78
Creator
Creator
Author

Great stuff Rudolf, knew I was missing something thank you

dplr-rn
Partner - Master III
Partner - Master III

brackets looks ok. couple of questions

- whats the issue with the results?

- is formula 1 and 2 giving right results?

sweens78
Creator
Creator
Author

Hi Dilip I was missing two brackets I had to put around each formula, is now working

Thanks for response