
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
color banding on multiple rows (using rank() ?)
This seems like this should be easy but I cannot get this to work. I want to alternate colors for rows of a table but the rows will be in groups of variable size. I thought that I could use the rank function to denote the groups and then flag the rank as even or odd to control the color banding, but this is not working for me for some reason. Here is some sample data:
Load * Inline [
Pt, Date, Product, Order
123, 1/1/2017, Apples, Order1
123, 1/1/2017, Pears, Order1
123, 1/1/2017, Oranges, Order2
123, 2/1/2017, Apples, Order3
123, 2/1/2017, Oranges, Order4
123, 2/1/2017, Bananas, Order5
123, 3/3/2017, Bananas, Order6
123, 3/3/2017, Pears, Order7
123, 3/3/2017, Apples, Order8
];
Here is what I am getting, The column Pt is first in the sort order...I know the rank function depends on sort order.
What I am after is this...
Thanks in advance for any help. Feel free to suggest an easier way to do this.
- « Previous Replies
-
- 1
- 2
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try,
if(mod(num#(Date(Date,'D')),2) = 0,red(),green())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Its an interesting solution, but in the example data I provided the 'D' for each date is an odd number so this formula colors the entire chart green.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PFA .
Used Expression is: if(mod(num#(Date(Date#(Date,'D/M/YYYY'),'D')),2)=0,White(),green())


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you try Something like this.
=if(Even(Day(Date))=0,Red(),Green())


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
PFA.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All of these solutions depend on the assumption that the dates are consecutive in some way, either consecutive days or months, etc. This assumption is not a good one for my data. If I change the sample data to this:
Load * Inline [
Pt, Date, Product, Order
123, 1/1/2017, Apples, Order1
123, 1/1/2017, Pears, Order1
123, 1/1/2017, Oranges, Order2
123, 2/1/2017, Apples, Order3
123, 2/1/2017, Oranges, Order4
123, 2/1/2017, Bananas, Order5
123, 4/3/2017, Bananas, Order6
123, 4/3/2017, Pears, Order7
123, 4/3/2017, Apples, Order8
];
This solution does not produce the desired results.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be like this
If(Even(RowNo(TOTAL)),Red(),Green())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Produces this result....not what I am after.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I apologize, my misunderstanding.
Try this :
In Script
Load *,AutoNumber(Pt&Date) as Flag
and condition like this
If(Even(Flag),Red(),Green())

- « Previous Replies
-
- 1
- 2
- Next Replies »