Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
AXK0121B
Contributor II
Contributor II

Convert Numeric value to string

We wanted to Convert a numeric value to String and then check the length of the string and if it exceeding 255 we need to get first 255 char or we need to load it as it is.

 

Below is the Code we are using , the case statement is working as the data is coming as numeric the code is failing

 

case when
length($code_value) > 255 then substr($code_value,1,instr($code_value, ";")+250)
else
$code_value
end

 

Is there a way we convert numeric to string.

 

Labels (1)
3 Replies
Heinvandenheuvel
Specialist III
Specialist III

A number 255 characters long? How can that be? Maybe we need to see some examples success/fail

>> Is there a way we convert numeric to string.  

Just contatenate with an empty string:     '' || $var

Similar to force to go from string to number :  0 + $var

Hein

 

sakatfu
Contributor
Contributor

Has anyone found a way to print a number variable in a string? Been trying to build a counter that can be used to display a number value for how much health or shields a player has, bur am struggling with the output.

john_wang
Support
Support

Hello @sakatfu ,

Welcome to Qlik Community forum and thanks for reaching out here!

As @Heinvandenheuvel pointed out the best approach is using the implicit data type conversion in previous comment. Would you please share a sample code if it does not work for you?

thanks,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!