Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nicouek
Contributor III
Contributor III

Set analysis/Expression/Calculation

Hi, all
I have a bit of a problem I need assistance with, your help will be much appreciated.

I have FIELDS:
[emp_ID]-->123456
[active_emp_flag]--> 'Y' OR 'N'
[year]--> 2022 - 2013

LOGIC: If Year = 2022, Count distinct [emp_ID] where [active_emp_flag] = 'Y'

OTHERWISE

Just Count distinct [emp_ID] for the other years.


if you need further information please ask

Thank you

Labels (1)
1 Solution

Accepted Solutions
nicouek
Contributor III
Contributor III
Author

Hi Luizcdepaula,

Thank you, your answer was very helpful, though the formula does fantastic in my line chart, it's crashing both my Pivot and Straight table visualizations (those are the two visualizations I have tested

nicouek_0-1660148549317.png

; nonetheless I appreciate your time and input.

Sincerely...

View solution in original post

4 Replies
luizcdepaula
Creator III
Creator III

Hi,

Try the below:

If(Year='2022',Count(distinct {<[active_emp_flag] ={'Y'}>}[emp_ID]),Count( distinct [emp_ID]))

I hope it works.

Cheers,

Luiz

nicouek
Contributor III
Contributor III
Author

Hi Luizcdepaula,

Thank you, your answer was very helpful, though the formula does fantastic in my line chart, it's crashing both my Pivot and Straight table visualizations (those are the two visualizations I have tested

nicouek_0-1660148549317.png

; nonetheless I appreciate your time and input.

Sincerely...

BrunPierre
Master
Master

nicouek
Contributor III
Contributor III
Author

Hi, Peter

Just PING the Admin in my environment, for a meeting to look into the "Calculation timed out"; I will review the resource you sent for personal edification, Thank you very much!