Re: Maximum dans un tableau.

33 views
Skip to first unread message

RG T

unread,
Dec 14, 2025, 2:01:35 PMDec 14
to Bill Crews, mementodatabase
Merci Bill pour votre réponse. En fait j'enregistre chaque jour, les indices UV pour les plages horaires de 8h00 à 20h00, et je voudtai le maximum des UV pour la journée. Votre solution et dites moi si me me trompes recherches sur la base entière et non pas sur une partie des données (journée), c'est pourquoi je doit passer par un script. 

Thanks Bill for your reply. Actually, I record the UV indices daily for the time slots from 8:00 AM to 8:00 PM, and I want the maximum UV values ​​for the day. Your solution—and please correct me if I'm wrong—searches the entire database and not just a portion of the data (the day), which is why I need to use a script.





Le dim. 14 déc. 2025, 19:47, Bill Crews <bill....@gmail.com> a écrit :
The first thing that comes to mind is to avoid scripting altogether, but rather just group by day (right-side menu in Android) and see whatever you want in the summary bars using Aggregation. 

La première chose qui me vient à l'esprit est d'éviter complètement l'utilisation de scripts, et de simplement regrouper les données par jour (via le menu de droite sous Android) et de consulter les informations souhaitées dans les barres récapitulatives à l'aide de la fonction d'agrégation.


On Sun, Dec 14, 2025, 13:00 RG T <trg...@gmail.com> wrote:
Bonjour à tous,
Dans une base de donnée  rassemblant les données journalières d'une station météo, je voudrai connaître l'indice UV maximum de la journée et non oas sur la base entière. J'ai crée ce code mais il me renvoi NaN alors que les données ne sont que des chiffres (0 à 15). J'ai crée un tableau et j'utilise Math.max pour rechercher dans ce tableau la valeur maximum. 
Merci pour votre aide.

Hello everyone,
In a database containing daily data from a weather station, I want to know the maximum UV index for the day, not the maximum UV index for the entire database. I created this code, but it returns NaN even though the data consists only of numbers (0 to 15). I created an array and I'm using Math.max to search for the maximum value within it.
Thank you for your help.

//---CALCUL INDICE UV
//---DECLARATIONS VARIABLES ---
var e = entry();
var UV8 = entry().field("Indice UV 8");
var UV9 = entry().field("Indice UV 9");
var UV10 = entry().field("Indice UV 10");
var UV11 = entry().field("Indice UV 11");
var UV12 = entry().field("Indice UV 12");
var UV13 = entry().field("Indice UV 13");
var UV14 = entry().field("Indice UV 14");
var UV15 = entry().field("Indice UV 15");
var UV16 = entry().field("Indice UV 16");
var UV17 = entry().field("Indice UV 17");
var UV18 = entry().field("Indice UV 18");
var UV19 = entry().field("Indice UV 19");
var UV20 = entry().field("Indice UV 20");

//-CREATION TABLEAU
var UV = [UV8 , UV9, UV10 , UV11 , UV12 (UV13 , UV14 , UV15 , UV16 , UV17 , UV18 , UV19 , UV20];

//-RECHERCHE MAX
var UV1 = Math.max(UV);

//-RESULTATS
"▪︎ ☀️ ▪︎ "+UV1+"\t\t\t\t\t\t\t\t("+ UV //<< CONTRÔLE

Bill Crews

unread,
Dec 14, 2025, 7:41:01 PMDec 14
to RG T, mementodatabase
If you total the UVs for the day (the entries are grouped by day), only the entries for that day are included. 

Reply all
Reply to author
Forward
0 new messages