Skip to content

adding an int element into an associative array #4612

@ghost

Description

hello,

i would like to create an associative array, to count how many nb of commande of the same number appears:
FOR
{% set cle = '' ~ commande %}
{% set dossiers = dossiers | merge({ (cle): (dossiers[cle] | default(0)) + 1 }) %}
ENDFOR
but the key is 0,1,2 instead of 353,832,156

how to resolve this problem ?

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions