Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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 (1)
3 Replies
its_anandrjs
Champion III
Champion III

Try with Getfieldselection() function

its_anandrjs
Champion III
Champion III

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?