Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
JLL72
Contributor II
Contributor II

if an alternate state filter is selected

Hi,

Can anyone please help with this?

I have a filter on  this column ( Employee)  using Alternate state A and 

and I want to write expression to say if the user has selected a value in that employee filter ( state A) or in other words, there is a value in that filter. then do my calculation:

 

if getselectedcount in this employee column ( state A ) =1,  sum ( Salary ) , other 0.

( i need to use alternate state for employee cus i need to unrelated this column to the other columns)

Thanks

Labels (2)
1 Solution

Accepted Solutions
joaopaulo_delco
Partner - Creator III
Partner - Creator III

To add another condition you can use the statement "or" like below:

if (GetSelectedCount(Employee, false(), 'state A' ) or ( "another condition" ),
Sum( {Exployee = selected value in state A} Salary),
0)

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

6 Replies
joaopaulo_delco
Partner - Creator III
Partner - Creator III

Hi @JLL72 

    You can do that way: 

if (GetSelectedCount(Employee, false(), 'state A' ), Sum(Salary),0)

I hope that help you!

Help users find answers! Don't forget to mark a solution that worked for you!
QFabian
Specialist III
Specialist III

Hi @JLL72 , you can try this too :

count( $({MyState} distinct Employee)

QFabian
JLL72
Contributor II
Contributor II
Author

I have another filter in Column Location using state B

not sure if i can do 2 states in a set analysis

JLL72
Contributor II
Contributor II
Author

Thank you -
How do I add another condition in the if statement to say

if (GetSelectedCount(Employee, false(), 'state A' ),
Sum( {Exployee = selected value in state A} Salary),
0) ?
thanks
MayilVahanan

Hi @joaopaulo_delco 

Try like below

=if(GetSelectedCount(Employee, True(), 'StateA'), Sum({<Employee=StateA::Employee>}Salary),0)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
joaopaulo_delco
Partner - Creator III
Partner - Creator III

To add another condition you can use the statement "or" like below:

if (GetSelectedCount(Employee, false(), 'state A' ) or ( "another condition" ),
Sum( {Exployee = selected value in state A} Salary),
0)

Help users find answers! Don't forget to mark a solution that worked for you!