Announcements
cancel
Showing results for
Did you mean:
Not applicable

## crossfoot

Hello,
I want to calculate the crossfoot of each content of a cell like:

FIELD1 | RESULT
123 | 6
0145 | 10
34 | 7
and so on.

Is there an possibility in QV to realize that without dividing each number into single digit fields to get the sum of the digits as crossfoot?

1 Solution

Accepted Solutions
Specialist

Hi,

I have been brooding over that for two months but had no idea. The best I could find for now is provided in enclosed little sample which works with MapSubstring and evaluate ... Have a look at it, perhaps it helps.

Rgds,
Joachim

5 Replies
Specialist

Hi,

I have been brooding over that for two months but had no idea. The best I could find for now is provided in enclosed little sample which works with MapSubstring and evaluate ... Have a look at it, perhaps it helps.

Rgds,
Joachim

rangesum(mid(FIELD1,1,1), mid(FIELD1,2,1),mid(FIELD1,3,1),mid(FIELD1,4,1))

-Rob

Not applicable
Author

Hello,

it's quite amazing in fact to get answers after about 2 month, that's good criteria for this forum.

In the meantime I solved the crossfoot problem via EXCEL = "SUMMENPRODUKT", but it was my goal to do in QV and not relapsing into Excel.

Now I will check your proposals, please wait and Thank You. DJ

Specialist

Another proposal (which would of course involve module script) would be a function as shown in my enclosed demo. This would be the most flexible and most transparent solution (of course one could surely still improve the algorithm behind the function itself, but it's working good enough for demonstration purposes), working also with commas, negative values etc and evaluate independent on the numbers of digits (as my former proposal which is of course not as slim). The only downside I can see for now is as said the involvement of a module script.

Rgds,
Joachim

Not applicable
Author

Hello,
Rob's solution works for my requirement (0,1,2,3,4 max.possible char=9) but one must be aware of the number of characters otherwise it would be uncertain.
---
Joachim's second solution also is fine but with the lack being outside the script.

Perhaps QV will implement a crossfoot function into standard because assessing severities in form of cumulating digits is routine in some branches.

Thank You. Greetings DJ

Community Browser