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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nicouek
Creator
Creator

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
Creator
Creator
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
Creator
Creator
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
Partner - Master II
Partner - Master II

nicouek
Creator
Creator
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!