In QuickSight, how to show only those employees who have incentive hours greater than 0 for the latest fortnight, but at the same time show all their historical incentive hours (including null or 0 or >0).
Goal:
Only show employees with incentive hours > 0 for the latest fortnight. ie, do not show any employees who is not flagged out for the latest fortnight incentive hours > 0
Display their complete incentive history** (even if they had null or 0 incentive hours in the past).
If i apply a filter like Latest Fortnight Incentive > 0 in QuickSight, it would exclude the historical records where the incentive is null or 0 because the filter would apply to the entire dataset right?
I have tried below steps but failed.
Identify the LatestFortnightFlag
“ifelse(endoffortnight = maxOver(endoffortnight, , PRE_AGG), 1, 0)”
IncentiveHoursFlag
ifelse(LatestFortnightFlag = 1 AND IncentiveHours> 0, 1, 0)
Filter the IncentiveHoursFlag=1 but it will filter out all the history.
Are you getting any error or not getting correct results . Could you please upload sample data and sample dashboard in QuickSight Arena , for us to check further and assist .
Almost there. However, this shows employees with no IncentiveHours for the latest fortnight. Please see the screenshot below. I’m only interested in those who have >0 IncentiveHours in the latest fortnight, along with their past IncentiveHours. If an employee doesn’t have IncentiveHours in the latest fortnight, they need to be filtered out.
The problem seems to be the computation of LatestFortnightFlag. Why does that get 1 in older dates?
Looking at 599 case where there is data in Aug 11 which is the only data for that employee and hence the highest. So, instead of defining what is Latest Fortnight from the dataset records you should define that outside of the dataset using a Parameter and/or calculated fields and use that date range to perform your checks for Incentive data as follows
IncentiveHoursFlag=
ifelse( >= FromDate and <= ToDate, ifelse( isNull(Unutilised) or Unutilised > 0 , 1, 0), 1)
Hi @Asfak,
Since we haven’t heard back, I’ll close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.