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: 
SomeDudeAtWork
Contributor III
Contributor III

Expression on selection

Hey all,

Does anyone know how to calculate for example a sum formula on a specific selection.

This is what i kind of created but i dont feel like if should be there
=if({<Team={"TeamA"}>},(sum([Sales])/(count(Distinct [~Date])*420*80)),
if({<Sub_Team={"English"},Vendor.SubTeam={"TeamA"}>},(sum([Sales])/(count(Distinct [~Date])*420*15)),'')))

Thinking of trying a Sum If

Any help would be greatly appreciated.

Labels (2)
3 Replies
its_anandrjs

Try with Getfieldselection() function

its_anandrjs

Try with below expression

 

=if( (GetSelectedCount(Team) + GetselectedCount(Sub_Team)+GetselectedCount(Vendor.SubTeam)) > 0,

if({<Team={"=$(=getfieldselections(ColA))"}>},(sum([Sales])/(count(Distinct [~Date])*420*80)),
if({<Sub_Team={"=$(=getfieldselections(ColA))"},Vendor.SubTeam={"=$(=getfieldselections(ColA))"}>},(sum([Sales])/(count(Distinct [~Date])*420*15)),'')))

,0)

SomeDudeAtWork
Contributor III
Contributor III
Author

Been trying it to no avail, also been looking into the If (and( kind of functions, but i have an error saying that and is not a valid function, would you know of an alternative?