Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sum of Tab - init to 0 but null with no value after init #1159

Closed
2 tasks done
JulienCarmona opened this issue Oct 21, 2024 · 2 comments
Closed
2 tasks done

Sum of Tab - init to 0 but null with no value after init #1159

JulienCarmona opened this issue Oct 21, 2024 · 2 comments
Assignees
Labels
Type: Bug Something isn't working

Comments

@JulienCarmona
Copy link
Contributor

JulienCarmona commented Oct 21, 2024

Describe the bug

Quand on fait la somme d'une colonne TAB_COL d'un tableau TAB en VTL dans un var claculée SUM_TAB = sum($TAB_COL$),

  1. Quand SUM_TAB est init, elle vaut 0.
  2. Mais si on ajoute des valeurs et qu'ensuite on es supprime (case vide), alors on a null

To Reproduce

  1. With the survey m2iwuqca on Pogues PROD
  2. Go to visu DSFR
  3. Go to recap, and see sum = 0
  4. Go back to TAB, enter 25 and 10
  5. Go to recap and see sum = 35
  6. Go back to TAB
  7. Erase values
  8. Go to Recap
  9. See error : sum = null

Expected behavior

On voudrait que la somme soit 0 aussi

Screenshots

  1. image
  2. Image
  3. image

Version where the bug appeared

Lunatic : 3.4.4

Browser where the bug was tested

  • Firefox
@JulienCarmona JulienCarmona added the Type: Bug Something isn't working label Oct 21, 2024
@JulienCarmona
Copy link
Contributor Author

Pas sûr de vouloir gérer ce cas, car on peut avec une variable intermédiaire calculée, gérer le null-check.
Ex avec le questionnaire m2iwuqca

  1. creer NULL_CHECK_TAB_COL = nvl($TAB_COL$,0) avec une portée TAB
  2. SUM_TAB = sum($NULL_CHECK_TAB_COL$)

@JulienCarmona
Copy link
Contributor Author

JulienCarmona commented Oct 23, 2024

C'est normal de ne pas pouvoir sommer des null et on ne veut pas que ce soit possible.
On va plutôt faire une documentation sur comment contourner ce problème :

  • Remonter la gestion de nullité pour qu'elle soit plus visible
  • Somme de null dans un tableau

cf ticket Doc Bowie

@JulienCarmona JulienCarmona closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants