Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rohanmayekar
Partner - Contributor III
Partner - Contributor III

need quick help with set analysis

following expression giving error,

=sum({< STDSalary-ActualSalary = {">=0"} >}STDSalary-ActualSalary)


but following works fine,


=sum({< Diffsalary = {">=0"} >}STDSalary-ActualSalary)    

requirement is to get 1st expression working as Diffsalary is dummy column i am using for testing purpose

NameSTDSalary ActualSalaryDiffSalary
Josh20203000980
James70007500500
Ron65007100600
may50005100100
Lois27002901201
rock990100111
jaimey990878-112
Lisa900800-100
diana17671600-167
hamosh20001800-200
ali1200980-220
daisy23231200-1123
linda2000200-1800
alex1789915000-2899
1 Solution

Accepted Solutions
sunny_talwar

The first one doesn't work because you are not allowed to use calculations/functions on the left hand side of the modifier... may be you can use this

=Sum({<Name = {"=STDSalary - ActualSalary >= 0"}>} STDSalary-ActualSalary)

or this

Sum(If(STDSalary - ActualSalary >= 0, STDSalary - ActualSalary))


or this


Sum(RangeMax(STDSalary - ActualSalary, 0))

View solution in original post

2 Replies
sunny_talwar

The first one doesn't work because you are not allowed to use calculations/functions on the left hand side of the modifier... may be you can use this

=Sum({<Name = {"=STDSalary - ActualSalary >= 0"}>} STDSalary-ActualSalary)

or this

Sum(If(STDSalary - ActualSalary >= 0, STDSalary - ActualSalary))


or this


Sum(RangeMax(STDSalary - ActualSalary, 0))

rohanmayekar
Partner - Contributor III
Partner - Contributor III
Author

Thanks For the help and explanation.