Jump to content
We've recently updated our Privacy Statement, available here ×

how to convert decimal to string in a calculated field


Jane.Yu

Recommended Posts

There is a field (decimal datatype from hive) with value like: 101110110 (only 0 and 1 in every digit).

1. I would like to create calculated fields in ad hoc views and extract every position from this value

1,0,1,1,1,0,1,1,0

2. I would like to get the count of '1' from this hive field, so the count is 6 for this example.

I tried to use java function String.valueof(), replace() in the calculated field, and it failed the validation.

There are no function to convert decimal to string or replace strings in Jasper report server for adhoc view calculated fields.

We can't change the datatype to string in hive. How can I create these calculated fields? Please help. Thank you.

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...