Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Baavik
Contributor III
Contributor III

Filter selection with alternate fields

Hi Team,

I have data of few scores for different items for different staff id. we need to compare month-wise individual score and get the count of staff who increased/decreased/same in their scores.

For this, I have created 2 alternate states Group1 and Group2 for different month selections and when I have to compare the individual scores, I am getting the total sum of all the scores of that month selection, used the below expression -

            If(sum({<Date={'$(=Date(Max({GROUP1}Date),'YYYY-MM-DD'))'}>}Score)<
            sum({<Date={'$(=Date(Max({GROUP2}Date),'YYYY-MM-DD'))'}>}Score),Count([Staff ID]))

Tried with only/count/distinct but no luck.

If score of selection 1 month < score of selection month 2 - Increase

If score of selection 1 month > score of selection month 2 - Decrease

If both scores are equal - Same.

 

All these status need to be represented in a stacked bar chart with different colour codes.

Attaching images for your reference.

Any leads is much appreciated !!! TIA !!

 

Baavik_0-1707884259575.png

 

 

 

 

Labels (1)
5 Replies
vincent_ardiet_
Specialist
Specialist

I don't understand what you are trying to represent in your bar chart and what is your issue exactly.

Baavik
Contributor III
Contributor III
Author

Hi @vincent_ardiet_ ,

Apologies!! Ignore the values in the bar chart.

I need to represent the count of staff id for those who are in increase/decrease/same states with different colour codes in the bar chart.

As per the above data ,comparing scores of selection 1 and 2, count of staff id should be like -

5 in same (grey colour), 4 increase (Green colour) and 1 decrease(Red colour).

 

Hope this is clear !! Thanks!!

 

vincent_ardiet_
Specialist
Specialist

You can create 3 measures, one for each status for example.

Baavik
Contributor III
Contributor III
Author

@vincent_ardiet_ 

Yes, that is where I am facing the issue. I have used the below expression for Increase state (if individual score of selection1 is < individual score of selection 2) as-

 If(sum({<Date={'$(=Date(Max({GROUP1}Date),'YYYY-MM-DD'))'}>}Score)<
            sum({<Date={'$(=Date(Max({GROUP2}Date),'YYYY-MM-DD'))'}>}Score)

Group1 and Group2 are month selections , in that I need the month-end data, so have taken max(date).

Now this expression is summing up all the scores and comparing but I need individual score comparison.

Tried with only, count,  but it didn't work.

vincent_ardiet_
Specialist
Specialist

Sorry I don't follow.
Could you illustrate with an example what you are trying to achieve?