Select to view content in your preferred language

calculation based on date no longer working inside repeat

171
1
a month ago
LynnBerni
Occasional Contributor II

The following calculation has worked perfectly for years, to create a unique SampleID for each record inside a repeat (BATCHDATE is the survey start date):

concat('BA ', format-date(${BATCHDATE}, '%Y%m%d '), format-date(once(now()), '%H%M%S%3'))

All other calculations inside the repeat are working as expected. No others are based on dates.  Given there have been a few weird things going with dates & repeats lately, I assume that's the problem.  This issue started sometime after 6/11, which is the last time my sample ID's calculated correctly.

Nothing is calculated, it is just Null.

I'm running Connect 3.20.63 and Field App 3.19.121

Xlsform attached for reference.

Thanks!

0 Kudos
1 Reply
albexulpoer
New Contributor
  1. Identify the Issue: Confirm that your date-based calculation is not functioning as expected within the repeat structure.

  2. Check Data Types: Ensure the date fields used in calculations are in the correct format (e.g., Date, DateTime).

  3. Review Repeat Settings: Verify that the repeat settings in your application or tool are correctly configured to handle date calculations.

  4. Debug Calculation Logic: Inspect the logic used for calculations to ensure it is valid and does not conflict with the repeat functionality.

  5. Update Dependencies: Make sure that all libraries or frameworks related to date handling and repeats are up to date.

  6. Test in Isolation: Run the date calculations like crs outside the repeat structure to confirm they work independently.

  7. Review Documentation: Consult the documentation for the specific tool or platform you’re using to check for known issues or limitations.

  8. Check for Errors: Look for any error messages or logs that might indicate what is causing the problem.

  9. Simplify Logic: Try simplifying the calculation to identify if a specific part of the logic is causing the issue.

  10. Seek Community Help: Look for forums or community discussions related to the tool or language you’re using for similar issues.

  11. Consider Cataz Tools: Explore Cataz-Net or similar resources for advanced date handling and calculation solutions.

  12. Implement a Workaround: If the issue persists, consider using alternative methods or workarounds to achieve the desired result while awaiting a fix or update.

 
0 Kudos