Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
rnepla83
Partner - Creator
Partner - Creator

Color rows in a straight table

Hi community 

i need to color the rows of a straight qlikview table (in the left of the image) as the one in the right of the image.
the rule could be:

- if the value of the first column is "Total" or "TOTAL" --> Yellow

- if the values is not "Total" or "TOTAL" then start to color the row as stripes (the first need to be always gray, then white)

 

 

I attach a file.

Thanks

clipboard_image_0.png

1 Solution

Accepted Solutions
sunny_talwar

Modification in the script will be a better option to do this

 

Table:
LOAD OCF_MOD_TOT_ITA_NW_BB_FM_ROWNUM, 
     Q_OCF_MKT_OR_MOD
FROM
[..\..\Downloads\Avanzamento OCF.xls]
(biff, embedded labels, table is Sheet1$);

tmpCumValueColorCode:
LOAD Q_OCF_MKT_OR_MOD,
	 Max(OCF_MOD_TOT_ITA_NW_BB_FM_ROWNUM) as MaxValue
Resident Table
Group By Q_OCF_MKT_OR_MOD;

CumValueColorCode:
LOAD If(WildMatch(Q_OCF_MKT_OR_MOD, '*Total*'), 0, RangeSum(Peek('CumValue'), 1)) as CumValue,
	 If(WildMatch(Q_OCF_MKT_OR_MOD, '*Total*'), 0, Mod(RangeSum(Peek('CumValue'), 1), 2)+1) as CumValueColorCode,
	 Q_OCF_MKT_OR_MOD
Resident tmpCumValueColorCode
Order By MaxValue;

DROP Table tmpCumValueColorCode;

 

 

 

image.png

View solution in original post

3 Replies
sunny_talwar

It is slightly different, but see if this works

image.png

 

 

=If(WildMatch(Q_OCF_MKT_OR_MOD, '*Total*'), Yellow(),
 If(Mod(Aggr(RangeSum(Above(If(WildMatch(Q_OCF_MKT_OR_MOD, '*Total*'), 0, 1), 0, RowNo())), (Q_OCF_MKT_OR_MOD, (=Max(OCF_MOD_TOT_ITA_NW_BB_FM_ROWNUM)))), 2) = 1, LightGray()))

 

 

 

rnepla83
Partner - Creator
Partner - Creator
Author

hey man,

 

 

really thanks. is almost the solution but the wish is to have grey after each yellow and then alternated stripes.

as in the image i attached.

 

Paolo.

sunny_talwar

Modification in the script will be a better option to do this

 

Table:
LOAD OCF_MOD_TOT_ITA_NW_BB_FM_ROWNUM, 
     Q_OCF_MKT_OR_MOD
FROM
[..\..\Downloads\Avanzamento OCF.xls]
(biff, embedded labels, table is Sheet1$);

tmpCumValueColorCode:
LOAD Q_OCF_MKT_OR_MOD,
	 Max(OCF_MOD_TOT_ITA_NW_BB_FM_ROWNUM) as MaxValue
Resident Table
Group By Q_OCF_MKT_OR_MOD;

CumValueColorCode:
LOAD If(WildMatch(Q_OCF_MKT_OR_MOD, '*Total*'), 0, RangeSum(Peek('CumValue'), 1)) as CumValue,
	 If(WildMatch(Q_OCF_MKT_OR_MOD, '*Total*'), 0, Mod(RangeSum(Peek('CumValue'), 1), 2)+1) as CumValueColorCode,
	 Q_OCF_MKT_OR_MOD
Resident tmpCumValueColorCode
Order By MaxValue;

DROP Table tmpCumValueColorCode;

 

 

 

image.png