Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Darmesh
Contributor III
Contributor III

Project scenarios

0683p000009LydD.png

 

Scenario 1 :

I have to insert comma in the values.

ex: 32825 o/p : 32,825

3281564 o/p : 3,281,564 

Before third digit i have to place comma.

 

Scenario 2 :

I have to replace the values -7.8 to (7.8)

need to replace open and close brackets for minus values.

Labels (2)
1 Solution

Accepted Solutions
Darmesh
Contributor III
Contributor III
Author

It worked after changing into this.

 

row11.EBITDA_MARGIN_Dec_17 .contains("-")?"("+row11.EBITDA_MARGIN_Dec_17 .replace("-","")+")": row11.EBITDA_MARGIN_Dec_17; 

View solution in original post

13 Replies
manodwhb
Champion II
Champion II

@Darmesh,

1:- if you were using tFileOutputExcel using to populate data,for the number filed you can specify Thousands separator.

 

0683p000009LyaZ.png

2:- you can use the below one.

!row1.filed.equals("") || row1.filed!=null||row1.filed.contains("-")>0?"("+row1.filed.replace("-","")+")": row1.filed

Darmesh
Contributor III
Contributor III
Author

@manodwhb

for scenario2 . am getting below error

 

0683p000009Lyd9.png0683p000009LyNV.png

Darmesh
Contributor III
Contributor III
Author

It worked after changing into this.

 

row11.EBITDA_MARGIN_Dec_17 .contains("-")?"("+row11.EBITDA_MARGIN_Dec_17 .replace("-","")+")": row11.EBITDA_MARGIN_Dec_17; 

manodwhb
Champion II
Champion II

try this

!row1.filed.equals("") || row1.filed!=null||row1.filed.contains("-")?"("+row1.filed.replace("-","")+")": row1.filed

Darmesh
Contributor III
Contributor III
Author

@manodwhb

It is working fine. But sometimes column will contain null values. so how to overcome null pointer exception.

Darmesh
Contributor III
Contributor III
Author

@manodwhb @TRF @rhall

 

It is working fine. But sometimes column will contain null values. so how to overcome null pointer exception.

manodwhb
Champion II
Champion II

Try the below one.

!row1.filed.equals("") || row1.filed!=null||row1.filed.contains("-")?"(row1.field==null?row1.field 0683p000009MPcz.png"+row1.filed.replace("-","")+")"): row1.filed
Darmesh
Contributor III
Contributor III
Author

Error after using the below code

 

String literal is not properly closed by a double-quote

 

!row1.filed.equals("") || row1.filed!=null||row1.filed.contains("-")?"(row1.field==null?row1.field"+row1.filed.replace("-","")+")"): row1.filed

manodwhb
Champion II
Champion II

try the below one.

 

!row1.filed.equals("") || row1.filed!=null||row1.filed.contains("-")?(row1.field==null?row1.field:"("+row1.filed.replace("-","")+")"): row1.filed