Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
konidena
Creator
Creator

set analysis - difference between -= and =- operations

Hi All,

Please someone clarify me that the difference between the operators -= and =-.

Below is the inline load

LOAD * INLINE [

    name, salary

    srinivas, 1

    sriram, 2

    srilatha, 3

    srinath, 4

    srinidhi, 5

    santhosh, 6

    madhu, 7

    gopi, 8

    aruna, 9

    dhanapriya, 10

];

Created the text box in the sheet and given the below query.

=sum({<name-={"sri*"}>}salary)--------returned "40" as the result

if i use "=sum({<name=-{"sri*"}>}salary)", returning the same result.

At what situations, these both will show the difference?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

=SUM({<name =- {'*sri*'}>}salary) and =SUM({<name -= {'*sri*'}>}salary)

will give you same result without selecting anything.

But if you select something... say srinidhi, santhosh, madhu

=SUM({<name =- {'*sri*'}>}salary) will still give you 40 but

=SUM({<name -= {'*sri*'}>}salary) will give you 13 as this expression is working wrt current selection.


So, in short, if you want SUM(Salary) excluding sri with respect to current selection use 2nd expression but if you want SUM(Salary) excluding sri but should not change based on selection in name, use 1st expression.


Hope this would make clear..

View solution in original post

4 Replies
MK_QSL
MVP
MVP

=SUM({<name =- {'*sri*'}>}salary) and =SUM({<name -= {'*sri*'}>}salary)

will give you same result without selecting anything.

But if you select something... say srinidhi, santhosh, madhu

=SUM({<name =- {'*sri*'}>}salary) will still give you 40 but

=SUM({<name -= {'*sri*'}>}salary) will give you 13 as this expression is working wrt current selection.


So, in short, if you want SUM(Salary) excluding sri with respect to current selection use 2nd expression but if you want SUM(Salary) excluding sri but should not change based on selection in name, use 1st expression.


Hope this would make clear..

konidena
Creator
Creator
Author

Thanks manish.It makes me clear now.

sunny_talwar

If you got what you were looking for, I suggest marking Manish's answer as corrrect and close the thread.

Best,

Sunny

MK_QSL
MVP
MVP

Can you close the thread by selecting correct answer?