Qlik Community

Qlik Sense App Development

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

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Background color for accumulation of Percentage values

I need background color for each line in the table based on Percentage accumulation reaches till 50% then Green and rest are Yellow. How to achieve this?

Capture.PNG

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

Hi,

I found this solution and it works perfectly. Thanks for you effort 🙂

=if(rangesum(above(total sum(IB_COUNT)/sum(Total IB_COUNT),0,RowNo(Total)))<=0.81, rgb(179, 198, 255),
if( rangesum(above(total sum(IB_COUNT)/sum(Total IB_COUNT),0,RowNo(Total)))>=0.80, rgb(255, 255, 204)))

View solution in original post

9 Replies
Highlighted
Creator II
Creator II

Hi,

Try this;

Aggr(
    If(Rangesum(Above(Sum(Percentage),1,RowNo()))<=0.5, green(),yellow()),
(Country, [Target Product],(=Sum(Percentage),Desc))
)
Highlighted
Creator III
Creator III

Hi,

Thanks for your reply!!

It's not working for me. I've attached the data for your reference. please let me know if you get any solutions.

Highlighted
Creator II
Creator II

Hi,

First, you should add row_number field with RecNo() at script level. Then you can use below expression to do the trick;

 

Aggr(
    If(Rangesum(Above(Sum(Percentage),1,RowNo()))<=0.5, green(), yellow()),
(rn,(=Sum(Percentage),Desc))
)
    

 

 

I will upload the sample .qvd when i go home.

Highlighted
Creator III
Creator III

Hi,

Thanks! Awaiting your reply.

Highlighted
Creator II
Creator II

Hi,

Check the attached app.

Highlighted
Creator III
Creator III

Hi, Still not getting the expected result. I've the Percentage Expression as =sum(IB_COUNT)/sum(total IB_COUNT) and I used the below format as your said. 

 

Aggr(

If(Rangesum(Above(sum(IB_COUNT)/sum(total IB_COUNT)),1,RowNo()))<=0.5, green(), yellow()

),(rn,(=(sum(IB_COUNT)/sum(total IB_COUNT)),Desc)))

 

Need help on this. Thanks!

Highlighted
Creator II
Creator II

Can you share the expected result as excel or image?

Highlighted
Creator III
Creator III

Hi,

Thanks for your response so far!

See the below image of which Blue color Background is should be <=80% . Percentage column is sort by largest to smallest.

Capture.PNG

Highlighted
Creator III
Creator III

Hi,

I found this solution and it works perfectly. Thanks for you effort 🙂

=if(rangesum(above(total sum(IB_COUNT)/sum(Total IB_COUNT),0,RowNo(Total)))<=0.81, rgb(179, 198, 255),
if( rangesum(above(total sum(IB_COUNT)/sum(Total IB_COUNT),0,RowNo(Total)))>=0.80, rgb(255, 255, 204)))

View solution in original post