Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Background Color in Straight table

Hi Qlikers

I have Straight table in my dashboard and wants something like below:

1.png

each GroupId has specific Color .the count of groupId is about 50000

i did it by formula :

if(even(aggr(distinct row(),GroupId )),gray(),white())

or

=if(Mod(aggr(NODISTINCT rowno(),GroupID),9)=0,RGB(0,0,0),

  if(Mod(aggr(NODISTINCT rowno(),GroupID),9)=1,RGB(30,30,30),

   If(Mod(aggr(NODISTINCT rowno(),GroupID),9)=2,RGB(60,60,60),

    if(Mod(aggr(NODISTINCT rowno(),GroupID),9)=3,RGB(90,90,90),

      If(Mod(aggr(NODISTINCT rowno(),GroupID),9)=4,RGB(120,120,120),

       if(Mod(aggr(NODISTINCT rowno(),GroupID),9)=5,RGB(150,150,150),

        if(Mod(aggr(NODISTINCT rowno(),GroupID),9)=7,RGB(180,180,180),

          if(Mod(aggr(NODISTINCT rowno(),GroupID),9)=8,RGB(210,210,210),RGB(240,240,240)

          ))))))))

but when I sort Table by Amount Column maybe tow same color with different groupId be  side each other

what should i do to have table like below:

2.png

Appreciate for answers

8 Replies
saimahasan
Partner - Creator III
Partner - Creator III

So basically if your expectation is just to get the same bgcolor for similar groups then sorting will definitely seperate the rows. How do you want it to be displayed??

passionate
Specialist
Specialist

Hi Samane,

You can use below eample.

Store the color codes in table/excel instead of writing complex expression.

PFA Solution and let me know for more information.

Regards,

Pankaj

Anonymous
Not applicable
Author

I have more than 50,000 groupId and can't set distinct rgb() for them

Anonymous
Not applicable
Author

I want each groupId has it's own color even in seprate form

for example i have  four groupId those are '7' with perple color

passionate
Specialist
Specialist

So, you mean there are 50000 record each with different color?

Anonymous
Not applicable
Author

more than 50,000 distinct groupId and each groupId maybe have more than one record

in my sample u can see groupId & have 4 record

passionate
Specialist
Specialist

In your expression i think till group ID 8 there are fix set of colors and then RGB(240,240,240) for other groupid's.

Is this what you require?

rubenmarin

Hi Samane, you can try with:

Mod(FieldIndex('GroupID',GroupID),9)

It will return a number based on the value of the field, not the position on the table.