Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

how to implement the sql decimal() and round() in to the qlikview and

hi all,

how to implement the sql decimal() and round() in to the qlikview

example 1:

round()

select round(field1,0) as field1 from table1

exapmle 2:

decimal()

select convert(decimal(3,0),field1) as field1 from table1

how to do this qlikview script?

5 Replies
prma7799
Master III
Master III

For Round you can simply put

Load

Round (Amount) as Amount

From ....;

and for Decimal

Num(sum(sales),'##.00') 

manoranjan_d
Specialist
Specialist
Author

ok thnaks

how to achive this

select *  round(isnull(field1,0),0) as field1 from table?

prma7799
Master III
Master III

Try like this

IF(ISNULL(field1 )=0, Round(field1 ), 0 ) AS field1 ;

manoranjan_d
Specialist
Specialist
Author

how to do this

(CASE WHEN ((field1 IS NOT NULL) OR (field2 IS NOT NULL)) THEN ISNULL(field1 ,'') + ', ' +

ISNULL(field2,'') ELSE field3 END) AS xxxx,

prma7799
Master III
Master III

Try  like this

if( ISNULL(Salary) = 0  or   (ISNULL(Salary) <> 0 )  ,  ISNULL(Salary) &','&  ISNULL(Salary,'')  ,  (Salary) ) as XXXX

Or

if(wildmatch([Account Name],'*Hong Kong*', 'HK',

if(wildmatch([Account Name],'*USA*', 'NY',

if(wildmatch([Account Name],'*UK*','LDN',

'OTHER')))

Please share some sample app

for SQL  Case statement we generally use "wildmatch" statement