Jump to content

Custom Expression


Abhishek Das 2

Recommended Posts

Hello All,

I have the below sample data and trying to limit it so that the graph only picks the records with lastest quote # version. e.g. From the below sample am trying to add a custom expression which only reflects the data from 1861398-3 and 1-12517759457-3. The last digit after the "hyphen" reflects the version.

Can anybody help me to achieve my goal

 

 

 

Case#

Quote#

$ Amount

 

 

632557

1861398-1

$1,318.80

 

 

632862

1861398-2

$2,073.32

 

 

632867

1861398-3

$422.75

 

 

632263

1-12517759457-1

3,756.48

 

 

632332

1-12517759457-2

15,060.37

 

 

632410

1-12517759457-3

1,315.56

Link to comment
Share on other sites

This is some messy data ;). Quotes and amount do not have consistent format...

You can still do a somewhat complex string split for your quotes but you have to catch all the cases. Sometimes you have just one '-' other times more. Make sure to modify the code for my calculated columns accordingly. I consider up to three '-'. The trick is to find the last '-' within the string.

You can limit your data now by Last Revision

 

For details please see attached dxp file.

Link to comment
Share on other sites

Before i saw your reply I worked on triming the quote # and succeded and was working on the coding to highlight the latest revison Quotes, I think your formula would work in my case am checking on that now. And Yes i would check the string limits (max) on my data. Thank you for prompt assistance.
Link to comment
Share on other sites

Sure.

 

It would be much nicer if the find function could also start from the right. Or if a string count function was available in Spotfire. This would enable a more general approach.

 

If you know how to work with data functions you can write a little function to do this task.

Link to comment
Share on other sites

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...