I use 'MinString(Product)' instead of 'Product' and it works, but I still have questions
1. I don't know why it works even after I check the function of 'MinString'. Can you help explain a little bit that why it works on this way?
2. Color of A is same as A1, so does B
3. What should I do if I want to put different color on 'A' & 'B'? I try to add expression as below but it doesn't work
Thank you for your advise in advance
1. MinString gets the first value sorted alphabetically, so it gets A1 for A, and B1 for B.
2. It was an example that it works when it has only one color to choose, but when it has more than one it will show grey.
3. By your screenshots seems that product 'A' and 'B', doesn't exists, they are created using a calculated dimension.
You can try with an expression like:
// Your initial script without MinString
// At the end add the colors for synthetic values, using Left() to get the first character
If(Left(MinString(Product), 1)='A', Yellow(),
If(Left(MinString(Product), 1)='B', RGB()
Thank you so much for the feedback and I am so sorry to bother you again
My client has made his request more specific.
Now he groups 'NewRelease' / 'Aged NoPSD' / 'M1M2 Make' / 'M1M2 Fail' into 'No PSD'
Groups 'OverAllFail M3' / 'OverAllFail M1M2' into 'OverAllFail'
Keep 'Overall Make' as 'Overall Make'
In this way, can we still use Minstring in this case? I try it but it doesn't work
Do you have any idea base on this new request?
You could refer to the attached raw data and qvf file for your reference
Hi Ivan, still can be done as:
if (Product='NewRelease',RGB (106,191,74),
if (Product='Aged NoPSD',RGB (226,35,26),
if (Product='M1M2 Make',RGB (255,106,0),
if (Product='M1M2 Fail',RGB (62,141,221),
if (Product='OverAllFail M3',RGB (233,107,175),
if (Product='OverAllFail M1M2',RGB (111,113,112),
if (Product='Overall Make',RGB (74,192,224),
if (Match(MinString(Product), 'Aged NoPSD', 'NewRelease', 'M1M2 Make', 'M1M2 Fail'), blue(),
if (Match(MinString(Product)='OverAllFail M1M2', 'OverAllFail M3'), yellow()
Another option can be to create a new field in script called [Product Group] (or similar), so the hierarchy has two levels: [Product Group] and [Product]. Then you have real values to select and apply colors using the real values for each level.
The simple way I found on this drilldown - coloring is,
writing IF() statement in a order of your last dimensions to be written first followed by subsequent dependent dimensions.Ex:
A -> B,C and C -> D,E,F then you should write an expression as;
Hope this helps.