Skip to main content

# App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$300 before February 6: REGISTER NOW!
cancel
Showing results for
Search instead for
Did you mean:
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)
• ### General Question

1 Solution

Accepted Solutions
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

; nonetheless I appreciate your time and input.

Sincerely...

4 Replies
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

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

; nonetheless I appreciate your time and input.

Sincerely...

Specialist II
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!

Tags
Community Browser