is on first selection of date from date filter the current count of emplid is compared with the total count of all the dates and give color accordingly which is wrong.
For eg. if for first time I select October then count corresponding to October is being compared with the count of Dec, Nov, Oct.
What is want is that when on first selection I select October then the October count should be compared with max date i.e. max_date variable data and on next selection the current filter selection count should be compared with the previous selected filter date and should give colors accordingly.
its again comparing with total value but not with the default max value....thats why showing in all green colors..
We want is that when we select any value from report date filter for first time then as previous selected value was by default max date, then the current selected value should be compared with the previous date selected value(default max date)
Though after first selection the cycle is working fine..
I see the problem... the problem is not the expression, its the way Qlik Sense's selection works... To make a change in selection, you have to make two selections. First you deselect what is already selected and then you select what you want to (or the other way around). For some reasons, they are considered two selections. May be you want to go back two selections with $2 instead of $1