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: 
Not applicable

Character data to integer

Hi,

Can anyone help me in this

How can I change this IF statement as I need to get integer for eg: 23145 instead of 'Others'

IF(len(trim(name))=0 OR ISNULL(name)=-1,'Others',name) AS name_New

Thanks.

8 Replies
Not applicable
Author

try this

if(

IF(len(trim(name))=0 OR ISNULL(name)=-1,'Others',name)='Others','23145'

)

or try this

if(

IF(len(trim(name))=0 ORISNULL(name)=-1,'Others',name)='Others','23145',

IF(len(trim(name))=0 OR ISNULL(name)=-1,'Others',name)

)

Not applicable
Author

Hi,

It's not working can you please let me know a bit more clearer.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     I am not sure what exactly you are looking for.

     Kindly explain with example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Actually

earlier I have fields which contains character data and the QVD is generated fine. Now That character is changed to integers as I need to generate Make tranformation and generate the QVD. as in the tranforamtion earlier it had been used

IF(WILDMATCH(xx,'abc*'),'abc',

IF(WILDMATCH(xx,'abc(ED)*'),'EDABC',xx))                                                              AS xx_New

now I have data instead of 'abc*' integer data is there. how can I make WILDMATCH to integer data and also i need to generate this like below that means

How can I change this IF statement as I need to get integer for eg: 23145 instead of 'Others'

IF(len(trim(name))=0 OR ISNULL(name)=-1,'Others',name) AS name_New

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

amelia2000 wrote:

Actually

earlier I have fields which contains character data and the QVD is generated fine. Now That character is changed to integers as I need to generate Make tranformation and generate the QVD. as in the tranforamtion earlier it had been used

         You can use the mapping load for changing your values from one form to another.

          For more information look into help for mapping load. There is a good example too.

    

          Now for

          IF(len(trim(name))=0 OR ISNULL(name)=-1,'Others',name) AS name_New

          Simply change the 'Others' to 23145

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

Earlier it contains character data that's why 'Others' is fine but noe there are so many integers like for eg: 12345, etc in this case how can I change? can you let me know.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     I guess it will be difficult to tell you unless you give some example of what was before and what is now with what exactly you are looking for.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

And as you said now to use mapping load in my case I don't have the table which contains character data it is earlier but now the entire character data is changed to integers in that how can I change?