Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
How to color code non aggregated tabular data based on increase of measure value ?
Table
Measure | Value | Year | Country | Region | Item | Component | Brand |
Rank | 8 | 2010 | India | North | Analgesic | BTB | Cipla |
Rank | 8 | 2011 | Japan | Central | Sedative | Acetylamylin | Pfizer |
Rank | 7 | 2009 | Japan | Central | Sedative | Acetylamylin | Pfizer |
Rank | 7 | 2009 | Korea | Coastal | Sedative | Acetylamylin | Pfizer |
Rank | 7 | 2009 | Japan | Bay | Sedative | Acetylamylin | Pfizer |
Rank | 6 | 2009 | India | North | Analgesic | BTB | Pfizer |
Hold | 5 | 2010 | Japan | Central | Sedative | Acetylamylin | Lupin |
Hold | 5 | 2010 | Korea | Coastal | Sedative | Acetylamylin | Lupin |
Hold | 5 | 2010 | Japan | Bay | Sedative | Acetylamylin | Lupin |
Hold | 4 | 2010 | India | North | Analgesic | BTB | Lupin |
Hold | 4 | 2011 | Korea | Coastal | Sedative | Acetylamylin | Lupin |
Rejection_Index | 4 | 2013 | Japan | Bay | Sedative | Acetylamylin | Pfizer |
Rejection_Index | 3 | 2011 | Japan | Central | Sedative | Acetylamylin | Pfizer |
Rejection_Index | 3 | 2012 | Japan | Central | Sedative | Acetylamylin | Pfizer |
Rejection_Index | 2 | 2011 | Japan | Central | Sedative | Acetylamylin | Pfizer |
Rejection_Index | 2 | 2011 | Korea | Coastal | Sedative | Acetylamylin | Pfizer |
Rejection_Index | 2 | 2011 | Japan | Bay | Sedative | Acetylamylin | Pfizer |
OutPut
New code
Legend:
LOAD Measure,
Value,
Year,
Country,
Region,
Item,
Component,
Brand
FROM
[Colour on Aggr Data.xlsx]
(ooxml, embedded labels, table is Table);
FinalTable:
LOAD *,
If(Measure = Previous(Measure) and Country = Previous(Country) and Region = Previous(Region) and
Item = Previous(Item) and Component = Previous(Component) and Brand = Previous(Brand) and Year > Previous(Year),
If(Value > Previous(Value), 'Positive',
If(Value < Previous(Value), 'Negative'))) as Trend
Resident Legend
Order By Measure, Country, Region, Item, Component, Brand, Year, Value;
DROP Table Legend;