Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tigra999
Contributor III
Contributor III

=if((x_state) <> 'X',sum({<component_code <> {X_COST}>} quantity),'0')

Hello,

Need to have help to create the correct formula in QS..

What I would like to calculate is the sum for all components not having x_state set to 'X' and all quantity for all components except for a component code 'X_COST'.

any idea how to solve this?

OK formula is

=if((x_state) <> 'X',sum(quantity),'0')

but when adding the wanted excluded item 'X_COST' I fail with the formula...

NOT OK formula:

=if((x_state) <> 'X',sum({<component_code <> {X_COST}>} quantity),'0')

The formula is OK when I switch/change the component code <> to = but I would like to do the opposite...

BR

peter

1 Solution

Accepted Solutions
arulsettu
Master III
Master III

maybe like this

sum({<component_code -= {'X_COST'}>} quantity)

View solution in original post

2 Replies
arulsettu
Master III
Master III

maybe like this

sum({<component_code -= {'X_COST'}>} quantity)

tigra999
Contributor III
Contributor III
Author

Thank you! a perfect solution 🙂