Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
[English first,
French below]
Hi everyone,
I got a problem to select the max value of a child.
I know its not very clear, ill try to explain my thought.
Data:
a Domain own a DomainStatus and a few Rules ( each Rule may have more than one exec )
a Rule own a RuleStatus and an ExecutionDate.
In the bellow exemple, the Domain only have 1 Rule, but that Rule ave 4 executions.
I forgot to mention that for the first table, depending status :
OK : green
KO : red
- : yellow
I want my first table to display the RuleStatus of the most recent execution only and ignore older executions.
Iv tried some things but coulnd figure it out.
What would be the definition of the expression of RuleStatus ?
Thanks!
Ulysse
_______________________________________________________________________________
Bonjour à tous,
J'ai un soucis pour ne selectionner que la valeur max d'un child d'un enregistrement.
Bon c'est pas très clair, je vais essayer de détaillé ça :
Données:
un Domain possède un StatusDomain et un ensemble de plusieurs Rule (et une Rule peut avoir plusieurs executions).
une Rule possède un StatusRule et une date d'execution.
Dans l'exemple, le Domaine n'a qu'une seule Rule, mais cette dernière a plusieurs date d'execution.
Actuellement , je souhaite avoir dans le tableau du haut uniquement le StatusRule de l'execution la plus récente.
En soit c'est tout simple, n'afficher que le StatusRule where max DateExec.
J'ai fait plusieurs essais infructueux, raison pour laquelle je me tourne vers la communanuté
Quel serait la définition de l'expression de StatusRule ?
Merci d'avance,
Ulysse
Ce message a été modifié par : Ulysse ROLAND english written
Can you please post your app.
Id prefer to avoid that option, im under confidentiality restrictions i cant bypass.
If you really need it, i will clean it and upload it.
Hi,
Did you try with FirstSortedValue()?
Try this in Dimension Tab.
firstsortedvalue ( Rule, DateExecution)
For more details see in help Menu
Regards
Here the app cleaned
The script :
domain:
LOAD * INLINE [
domain, domainStatus
domain1, OK
domain2, KO
]
;
OUTER JOIN (domain)
LOAD * INLINE [
domain, rule, ruleStatus, execDate
domain1, rule1, KO, 2014-08-20
domain1, rule1, KO, 2014-08-21
domain1, rule1, OK, 2014-08-26
domain1, rule2, KO, 2014-08-22
domain1, rule2, OK, 2014-08-24
domain2, rule3, KO, 2014-08-19
]
;
When i read your post and doc this seems to be the exact solution, but i failed to implement it.
I have tried using FirstSortedValue() over the dimension and the expressions, both failed to render the expected value.
(with the app i uploaded on gdrive)
- I tried on dimension FirstSortedValue(rule, execDate)
- and also on expression FirstSortedValue(ruleStatus, execDate)
I know thats kinda a basic case, and im missing something..
=FirstSortedValue(ruleStatus, execDate) is working in expression
I didnt see it the first time... white text color on yellow background 😕
my bad!
Thanks for your answers!
Ulysse
Hi,
maybe like this?:
hope this helps
cordialement
Marco
for the most recent execution date try with negative execDate values:
=FirstSortedValue(ruleStatus, -execDate)
cordialement
Marco
Thats it!
Thank you Marco