Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Wallibee
Contributor III
Contributor III

How to use Convert and Case SQL functions in QlikS

 
 

 

Hi 

 

I want to use following SQL statement in Qlik, how can we use it script?

 

    convert(varchar,Relationnumber) AS keynumber,

 

    case when countrycode in ('S','SE') then SUBSTRING(Postnummer,1,4) else Postnummer end AS Newcode

 

Thanks in advance

@mindaugas2048 

1 Solution

Accepted Solutions
Anil_Babu_Samineni

You have to use mid in qlik as mentioned in the expression 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

5 Replies
Anil_Babu_Samineni

Check this

https://help.qlik.com/sv-SE/sense/September2020/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptCon...

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Wallibee
Contributor III
Contributor III
Author

thanks @Anil_Babu_Samineni  for your responds .

Sorry but the link does not answer the question, Do you mean to say switch is the  replace syntax for convert ? 

Anil_Babu_Samineni

We don't know where you are using. If you are using as field may be

If(match(countrycode, 'S','SE'),  mid(Postnummer,1,4), Postnummer) AS Newcode

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Wallibee
Contributor III
Contributor III
Author

I am applying this in QS and  countrycode is a field . I was wondering if substring works in  QS scripting as a function 

Anil_Babu_Samineni

You have to use mid in qlik as mentioned in the expression 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful