Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago

Date sequence validation for duplicates

Hello everyone

I appreciate if you can help me with this consultation. I have the following table:

I need to perform the following validations:

- check if there is duplicate data in the "Order" column since it is with this data that I will work.

- once identified, validate that the number of the "Invoice" field whose "Status" field is "FILED" is less than the second record

- After that, validate that the "Cancellation Date" of the line indicating "FILE" of the duplicate pair is later than the "Date of issue" of the same line and that, in turn, it is prior to the date of issuance of the second record (the one with the invoice number greater than the duplicate pair. consider date and time.

- if this sequence is correct, indicate OK in the "Result" field of the line in which the "Status" field indicates "FILE".

- if incorrect, indicate "Error".

- For orders that are not duplicated, leave the "Result" field blank

Finally, create a calculated measure that counts how many "Errors" there are in the column, without counting blank spaces.

The result would be something like this:

I hope you can help me.

Thank you so much!

8 Replies

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Hello, thanks for the clarification.

      I attach the requested detail:

      InvoiceOrderStateIssue dateCancellation dateResult
      235-2023-000478000173751473LEGAJADA01/02/2023 19:23:2201/02/2023 19:27:02ok
      235-2023-000481000173751473Regularized01/02/2023 22:27:27
      235-2023-000026014494368514LEGAJADA03/01/2023 18:29:0204/01/2023 18:24:54Error
      235-2023-000046014494368514Regularized04/01/2023 18:23:30
      235-2023-000176014494368993Regularized12/01/2023 18:47:41
      235-2023-000181014494368993Regularized12/01/2023 18:47:41
      235-2023-000185014494369015LEGAJADA13/01/2023 00:19:0313/01/2023 00:22:56Ok
      235-2023-000201014494369015Regularized13/01/2023 19:39:18
      235-2023-000186014494369026LEGAJADA13/01/2023 00:19:0313/01/2023 00:22:57Ok
      235-2023-000202014494369026Regularized13/01/2023 19:39:18
      235-2023-000204014494369030Regularized13/01/2023 19:39:18
      235-2023-000249014494369170LEGAJADA17/01/2023 18:46:5319/01/2023 11:22:15Error
      235-2023-000271014494369170Regularized18/01/2023 18:30:04
      235-2023-000247014494369214LEGAJADA17/01/2023 18:46:5318/01/2023 11:22:14Ok
      235-2023-000268014494369214Regularized18/01/2023 18:30:04
      235-2023-000438014494377323LEGAJADA30/01/2023 19:20:4231/01/2023 12:18:38Ok
      235-2023-000466014494377323Regularized31/01/2023 23:03:30
      235-2023-000821014494394521LEGAJADA21/01/2023 18:38:2322/02/2023 16:16:00Ok
      235-2023-000840014494394521Regularized22/02/2023 17:12:41

      In addition to this, the calculated measure of how many errors there are. In this case, it should show 2 on the visual card I will place.

      Thanks again.

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator
      Thanks for the reply. On the result, this OK, however I have left another condition: - there may be records with cancellation date but that does not have duplicate the order. in this case, it should also be OK. Please your help. Thank you.
      • Ahmedx's avatar
        Ahmedx
        Super User

        show me an example so I can understand you