Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm working on an app to calculate the total cost per unit. The only challenge is there may be multiple units indicated in a single field and I need to divide by the total count of units of all rows.
For example:
BEAU5526356, GCXU5523584, TCNU4967930 are in 1 row of data, so I'd need to show a count of 3 for this row.
Is anyone aware of a means to count these rows and then calculate a total? The total part should be straightforward; but I've no idea how to calculate a count within a field.
Thanks in advance!
You can use SubStringCount and count the commas + 1.
You can use SubStringCount and count the commas + 1.
Vincent,
Thank you. This works perfectly!
Note that you can also use SubField in your loading script to split those strings into rows (in a separate table for example). But it depends of what you want to do next and of the amount of data you have. However SubStringCount could be enough for your need.