Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New Contributor III

SQL Topic

How convert 20k sal into 20,000 in sql server

7 Replies
Highlighted
Contributor III

Re: SQL Topic

You can use the SQL replace function

SELECT REPLACE('20k', 'k', ',000');

or

SELECT REPLACE('20k sal', 'k sal', ',000');

Highlighted
New Contributor III

Re: SQL Topic

sal is column name

actualdata          requirment

sal                    sal

20k                    20,000

10k                    10,000

12k                    12,000

Highlighted
Contributor III

Re: SQL Topic

SELECT REPLACE(sal, 'k', ',000') as sal from table1

Highlighted
Valued Contributor

Re: SQL Topic

Re: SQL Topic

srinu qvdApprentice

Highlighted
New Contributor III

Re: SQL Topic

no i did't get it

Highlighted
Valued Contributor

Re: SQL Topic

Use following in your load script in qlikview or sense:


load REPLACE(sal, 'k', '000') as sal from database.tablename

Highlighted
Valued Contributor

Re: SQL Topic

Hi, srinu:

1- option:

LOAD *, KeepChar(sal,'0123456789')*1000 as FieldSal;
LOAD * Inline
[
sal
10k
20k
30k
]
;

salry.png