Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have following chart.
Nbre TA and Nbre T are an expression
I want to have in the field “RES” the result under
Someone have an idea to have the following result
18,75 = (3/16)*100 |
25= (4/16)*100 |
56,25=(9/16)*100 |
ZP | Nbre TA | Nbre T | CAM | LOC | RES |
ZP | 2 | 3 | ALCL | - | 18,75 |
ZP | 3 | 4 | SOCO | SOCO | 25 |
ZP | 5 | 9 | SOCO | - | 56,25 |
| 10 | 16 |
|
| 100 |
The following will make sure there is something in the ZP field (makes sure the length is at least one character):
sum(total aggr(count({<ISO={'20'},ZP={'?*'}>}distinct HMCONT) + (count({<ISO={'40'},ZP={'?*'}>}distinct HMCONT)*2),ZP,CAM,LOC))*100
Expression would be:
=[Nbre T]/sum(total [Nbre T])*100
Example file also attached.
The expression for RES field is:
sum(NbreT) / sum(TOTAL NbreT) * 100
Hope it helps
Hi,
[Nbre T] is an expression, this makes Sum(TOTAL not work in the given formula.
Could you give us the formula of [Nbre T] and the dimensions of your chart? It seems the best would be to adapt this formula to get the total...
Thank you all for replies, you are right Pierre, the total sum does not work with tese expressions.
Find under the formula for NbreT
count(distinct if( ISO='20', HMCONT)) + (count(distinct if( ISO='40', HMCONT))*2)
dimensions are CAM and ZP
count(distinct if( ISO='20', HMCONT)) + (count(distinct if( ISO='40', HMCONT))*2) can be written a bit better:
count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2)
Then the RES expression would be:
count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2) /
sum(aggr(count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2),CAM,ZP)) * 100
The expression gives me in RES column, the value under
RES
67.67
52,00
89.98
The data are wrong
It will be
18,75 |
25 |
56,25 |
I think I forgot the TOTAL keyword:
count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2) /
sum(total aggr(count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2),CAM,ZP)) * 100
I try this expression but the result is always false
RES:
1.55
2,55
3,21
Can you just put this in the chart and tell me what it is returning (once with the total and once without):
1. sum(aggr(count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2),CAM,ZP))
2. sum(total aggr(count({<ISO={'20'}>}distinct HMCONT) + (count({<ISO={'40'}>}distinct HMCONT)*2),CAM,ZP))