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: 
NBen15
Contributor II
Contributor II

Use Sql like operator in tJava

Hello,

I have two questions :

1- I want to use a regular expression in the tJava component, I extract a field from the database then I check if it is in this format:

F0*0*-03* the stars represent a character

I did this in sql with the following query:

select * from sales where product like ''F0_0_-03_'

How can I do this with a tJava?

2) - I get a field from the database and in output I declared this field in BIG DECIMAL

for example :

input: 4.00000000000000000

output: 4,000,000,000000

I want to have an output like 4,000000000000 with only one comma, I checked the separator option in my excel file (tFileOutputExcel)

0695b00000PJytEAAT.png

Labels (2)
1 Solution

Accepted Solutions
NBen15
Contributor II
Contributor II
Author

Thank you for your feedback it works 😄

View solution in original post

4 Replies
Anonymous
Not applicable

For the regex, this is a very quick and basic example of what I think will work....

 

(F0).*(0).*(-03).*

 

You can test regular expressions here....

https://regex101.com/

 

In your Excel component you have set the thousands separator. I think you have an issue here with your system config and your source and target data. You will need to identify what your system decimal and thousand separators are as I suspect there is some misalignment here given the numbers you are showing.

 

gjeremy1617088143

Hi , to complete what @Richard Hall​ says if you want just one character instead of _ :

"F0.0.-03."

NBen15
Contributor II
Contributor II
Author

Thank you for your feedback it works 😄

NBen15
Contributor II
Contributor II
Author

Thank you 🙂