Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

associate a string to a number

Hi everyone,

I get data in form of numbers.I have to assign a string to it.

Thanks,

Asmita

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Your requirement is still somwhat unclear, an example always helps to understand.

You can look into conditional functions to assign strings to your numbers when loading in, or look into a Mapping approach:

1)

LOAD Number,

          if(Number = 1, 'One',

               if(Number = 10, 'Ten',

                    if(Number = 100, 'Hundred')

                 )

          )                                         as NumberText

FROM ....;

2)

NumberMap:

MAPPING LOAD * INLINE [

F1, F2

1, One

10, Ten

100, Hundred

];

LOAD Number,

          applymap('NumberMap', Number) as NumberText

FROM ...;

View solution in original post

3 Replies
Not applicable
Author

hi

try text(fieldname)  function

swuehl
Champion III
Champion III

Your requirement is still somwhat unclear, an example always helps to understand.

You can look into conditional functions to assign strings to your numbers when loading in, or look into a Mapping approach:

1)

LOAD Number,

          if(Number = 1, 'One',

               if(Number = 10, 'Ten',

                    if(Number = 100, 'Hundred')

                 )

          )                                         as NumberText

FROM ....;

2)

NumberMap:

MAPPING LOAD * INLINE [

F1, F2

1, One

10, Ten

100, Hundred

];

LOAD Number,

          applymap('NumberMap', Number) as NumberText

FROM ...;

Not applicable
Author

Thanks,

The if loop worked