0

I have the following problem:

  • I have a table with 4 thousand records with the following columns, id, strategy, option and data.

  • The numbers are random, line by line.

  • I needed to check if the previous 3 records are part of my pattern and search for the next 2 numbers, line by line.

Example

My previous strategies for the search are:

strategy: 4
strategy: 2
strategy: 9
current: 14

Now I need to look for the next strategy, which in this case would be 11, so I needed to consult the last 4 strategies and check if they match the ones I'm looking for.

I would need to fetch 4,2,9,14 and find 11, and it would have to be in ID order.

Below is an example print of my table: an example print of my table.

pjs
  • 18,696
  • 4
  • 27
  • 56
  • I'm failing to see why this is tagged `random`. Your strategy column is tabled, not random. Where did the prior strategies come from, and what's the basis for picking 11 as the next one vs 5 or 6? – pjs Aug 24 '22 at 02:39
  • These strategies are updated by the marketing team, the numbers range from 1 to 14 of strategy. The strategy column is random, but each number in it has an exact option. But I need to predict when the next strategy will be based on the old sequence of numbers. – Bruno César Aug 25 '22 at 23:36
  • For example, the marketing team launched the following strategies: 14 facebook 12 facebook 0 google I need to predict, based on the previous 3 records which will be the next one, based on the pattern. There are only 3 strategy options: Facebook linkedin Google However, the strategy number refers to an option in the CRM. This strategy number refers to the investment you will make. For example, I will make a 4 strategy investment in linkedin option. Did you understand? @pjs – Bruno César Aug 25 '22 at 23:36

0 Answers0