Try using the below command
Have a condition before you group
even-skip-page-count ---> contains <?section:force-page-count;'end-on-even-layout'?>
When you want to handle the suppression of the even pages from the total number of pages
you can use the following command within the even-skip-page-count form field --> <?section:xdofo:blank-on;'even-skip-page-count'?>
If this helps you then please mark the answer as "correct" or else "helpful"
Thanks for your answer, I tried it but it didnt give the desired output, I have many groups in my RTF and I want the condition to apply on the one of the detail groups since the page number resets everytime once the master record changes.
My solution works only if I can include the page number in the IF condition, is there any way to do that?