Classement de listes à cocher / Sorting check lists

Bonjour,

J’ai un défi dans obsidian, j’ai essayé mais n’y suis pas arrivé.
J’espère pouvoir clairement expliquer ce que je voudrais réaliser.

Je vous donne un cas concret:

J’ai 5 listes avec 10 cases à cocher dans chaque listes:
-Liste 1
-liste 2
-Liste 3
-Liste 4
-Liste 5

Dans la liste 1 je coche 3 cases à cocher
Dans la liste 2 je coche 1 case à cocher
Dans la liste 3 je coche 7 cases à cocher
Dans la liste 4 je coche 4 cases à cocher
Dans la liste 5 je coche 1 case à cocher

Ensuite dans un nouveau tableau, je voudrais
classer le nom des listes du dessus dans l’ordre descendant
en fonction du nombre de lignes cochées dans chaque tableaux.

Dans le cas concret cela donne:
Liste 3
Liste 4
Liste 1
Liste 2
Liste 5

Voilà,
merci infiniment de votre réponse


Good morning,

I have a challenge in obsidian, I tried but couldn’t do it.
I hope I can clearly explain what I would like to achieve.

I’ll give you a concrete case:

I have 5 lists with 10 checkboxes in each list:
-List 1
-list 2
-List 3
-List 4
-List 5

In list 1 I check 3 check boxes
In list 2 I check 1 check box
In list 3 I check 7 check boxes
In list 4 I check 4 check boxes
In list 5 I check 1 check box

Then in a new table, I would like
sort the names of the lists above in descending order
depending on the number of lines checked in each table.

In the concrete case this gives:
List 3
List 4
List 1
List 2
List 5

So,
thank you very much for your response

What do you mean with a list with checkboxes? Could you show the actual text used? And what should present the result, dataview? Only core Obsidian?

Thank you for the answer.
Here is the actual texte in obsidian:
This is the example of the lists:

1. Acide-Déminéralisé

#Terrain_a

  • Douleurs articulaires/musculaires fréquentes
  • Caries dentaires ou ongles cassants
  • Consommation élevée d’aliments acidifiants
  • Fatigue matinale persistante
  • Antécédents de calculs rénaux
  • Peau sèche/cheveux ternes

2. Baso-Colitique

#Terrain_b

  • Ballonnements/diarrhées chroniques
  • Intolérances alimentaires identifiées
  • Infections ORL/urinaires récurrentes
  • Faible consommation de fibres
  • Rhumes fréquents (>4/an)
  • Prise récente d’antibiotiques

3. Carencé en AGPI

#Terrain_c

  • Eczéma/peau sèche
  • Troubles cognitifs (mémoire/concentration)
  • Sautes d’humeur inexpliquées
  • Faible consommation d’oméga-3
  • Cholestérol/triglycérides élevés
  • Déséquilibres hormonaux

4. Hypoglycémique

#Terrain_h

  • Fringales sucrées quotidiennes
  • Tremblements en jeûne
  • Variations énergétiques brutales
  • Consommation de sucres rapides >2x/jour
  • Réveils nocturnes fréquents
  • Anxiété post-prandiale

5. Intoxiqué

#Terrain_i

  • Exposition professionnelle toxique
  • Transpiration odorante
  • Céphalées chroniques
  • Consommation régulière d’alcool/tabac
  • Prise de poids paradoxale
  • Lourdeurs digestives post-repas

And here is the actual Dataview markdown:

TASK
FROM "99 - CABINET/ANNAMNESE" AND (#Monsieur_x) 
WHERE completed

Now what is difficult is to sort the tables with the different titles (example: ### 1. Acide-Déminéralisé) or with the tag (example: #Terrain_a)

You can’t use the tag since that’s connected to the page, and not any of the sections or lists. The lists are connected to the sections so those can be used in combination with GROUP BY.

I’m a little busy right now, but I can write you an example query in a few hours (I hope).

Thank you very much for the example.
I can wait
thank you

I took some time, but here is a working example where I copied all your tasks into a given note, and added the query at the end (so you’ll need to adapt the WHERE to match your FROM/WHERE combination.

```dataview
TABLE completedCount, completedTasks.text
WHERE file = this.file
FLATTEN file.tasks as task
FLATTEN meta(task.section).subpath as header
GROUP BY header
FLATTEN list(filter(rows.task, (t) => t.completed)) as completedTasks
FLATTEN length(completedTasks) as completedCount
SORT completedCount desc
```

This query with the example data from above (and some slight modification as to what was crossed out, it then gave this output:

My tasks gets added the completion date, so sorry for that “noise”, and I included a column in the table with which tasks was actually completed. Similar list could of course also be built for the non-completed tasks, if you so want. Then just use !t.completed instead.

Hope this gives you enough information to adapt into your likings. The trick to the query is using the filter() to pull out the completed tasks, and using meta(task.section).subpath to pull the header for a given tasks, and then grouping on that information.

Do note, that after we’ve done the GROUP BY all the data are now collated into lists within the rows object, and the group by expression is stored in the key (which is automatically used as the first column).

So thank youuuuuuuuu !!!
I will try it but it’s exactly hat I need.
Thank you very much