Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
MuraliPrasath
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

1 Solution

Accepted Solutions
MuraliPrasath
Creator III
Creator III
Author

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
mfarsln
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))
)
MuraliPrasath
Creator III
Creator III
Author

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.

mfarsln
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.

MuraliPrasath
Creator III
Creator III
Author

Hi,

Thanks! Awaiting your reply.

mfarsln
Creator II
Creator II

Hi,

Check the attached app.

MuraliPrasath
Creator III
Creator III
Author

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!

mfarsln
Creator II
Creator II

Can you share the expected result as excel or image?

MuraliPrasath
Creator III
Creator III
Author

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

MuraliPrasath
Creator III
Creator III
Author

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)))