GKIL67
Technical User
- Dec 1, 2009
- 44
Hello,
I have the output of a crosstab query that has finite number of columns [BALL] as numbers (i.e. 1, 2, 3... 45) and
each row [CNT] has a unique ascenting number as a name (i.e. 137, 138, 139...).
The value [SKIPS] can be any number, including 0. Each column could start or end by a NULL.
I want to find for each column [BALL] if there are ANY series of combinations of numbers [SKIPS] that
repeat (I don't know it in advance) and if THERE ARE, then how many times they repeat.
The search starts from the lowest [CNT] to the highest [CNT].
The series of combination of numbers (how many numbers in a combination at a time) has to be controled
by an X parameter, i.e. X=2 means to check for repeating patterns of 2 numbers.
I've found very few functions around that process strings of letters for this purpose and in my case there
are numbers to deal with... moreover, I dont have them in a string!
I understand that that's not an easy thing to solve, morever on a query level.
I would really appreciate any help that could put in the right track.
Below is an example of the output of the crosstab query, with columns 3 and 35:
cnt 3 35
137 28
138 8
139 11
140 6
141 0 11
142 2 3
143 0 3
144 17 14
145 4 8
146 1 5
147 21 13
148 34
149 4
150 4
151 4
152 1
153 8
154 17
155 13
156 34
157 14
158 6
159 11
160
161
Below is the expected outcome, assuming that it writes in a table:
i.e. tblPatRep for X=2 and columns 3 and 35:
clmn Location Pattern X
3 0 0 2
35 147 13, 34 2
35 155 13, 34 2
Thank you in advance!
I have the output of a crosstab query that has finite number of columns [BALL] as numbers (i.e. 1, 2, 3... 45) and
each row [CNT] has a unique ascenting number as a name (i.e. 137, 138, 139...).
The value [SKIPS] can be any number, including 0. Each column could start or end by a NULL.
I want to find for each column [BALL] if there are ANY series of combinations of numbers [SKIPS] that
repeat (I don't know it in advance) and if THERE ARE, then how many times they repeat.
The search starts from the lowest [CNT] to the highest [CNT].
The series of combination of numbers (how many numbers in a combination at a time) has to be controled
by an X parameter, i.e. X=2 means to check for repeating patterns of 2 numbers.
I've found very few functions around that process strings of letters for this purpose and in my case there
are numbers to deal with... moreover, I dont have them in a string!
I understand that that's not an easy thing to solve, morever on a query level.
I would really appreciate any help that could put in the right track.
Below is an example of the output of the crosstab query, with columns 3 and 35:
cnt 3 35
137 28
138 8
139 11
140 6
141 0 11
142 2 3
143 0 3
144 17 14
145 4 8
146 1 5
147 21 13
148 34
149 4
150 4
151 4
152 1
153 8
154 17
155 13
156 34
157 14
158 6
159 11
160
161
Below is the expected outcome, assuming that it writes in a table:
i.e. tblPatRep for X=2 and columns 3 and 35:
clmn Location Pattern X
3 0 0 2
35 147 13, 34 2
35 155 13, 34 2
Thank you in advance!