KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Concatenation issue for atomic values Re: Concatenation issue for atomic values

  • rocuinneagain

    Member
    October 7, 2021 at 12:00 am

    A single character .i.e “1” is a type -10h
    A list of characters .i.e “10” is a type 10h
    You can create a single character list using ‘enlist’ .i.e

    q)type each ("1";"0";"11-15") /Some are lists some are not 
    -10 -10 10h 
    q)type each (enlist "1";enlist "0";"11-15") /All are lists 
    10 10 10h 
    q)("1";"0") 
    "10" 
    q)type each ("1";"0") 
    -10 -10h 
    q)(enlist "1";enlist "0") //Using enlist to make single character lists 
    ,"1" ,"0" 
    q)type each (enlist "1";enlist "0") 
    10 10h

    Using ‘enlist’ will help prevent unwanted concatenation for you.
    https://code.kx.com/q/ref/enlist/