Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community
I created a field trigger which changed a field value(seperated table) according the selected period.
Action: Select in Field
Field: Period_Info
=if(Max(Date)=Max({1}Date) and Min(Date)=(Max({1}Date)-6), 'Last 7 days',
if(Max(Date)=Max({1}Date) and Min(Date)=(Max({1}Date)-29), 'Last 30 days',
if(Max(Date)=WeekEnd(Max({1}Date),-1) and Min(Date)=WeekStart(Max({1}Date),-1), 'Last Week',
if(Max(Date)=MonthEnd(Max({1}Date),-1) and Min(Date)=MonthStart(Max({1}Date),-1), 'Last Month',
'Individual'))))
For 'Last 7 days' & 'Last 30 days' the trigger works fine but for 'Last Week' & 'Last Month' the trigger select 'Individual'.
I checked the value in text boxes and they are correct and also tried with variables for 'Last Week'/'Last Month'. Same results.
Can someone advice me why the trigger is not working correctly ?
Best regards,
Ronny
Weekstart and monthstart are not rounded numbers
use a floor function before them
if(Max(Date)=floor(WeekEnd(Max({1}Date),-1)) and Min(Date)=floor(WeekStart(Max({1}Date),-1)), 'Last Week',
if(Max(Date)=floor(MonthEnd(Max({1}Date),-1)) and Min(Date)=floor(MonthStart(Max({1}Date),-1)), 'Last Month',
'Individual'))))
Weekstart and monthstart are not rounded numbers
use a floor function before them
if(Max(Date)=floor(WeekEnd(Max({1}Date),-1)) and Min(Date)=floor(WeekStart(Max({1}Date),-1)), 'Last Week',
if(Max(Date)=floor(MonthEnd(Max({1}Date),-1)) and Min(Date)=floor(MonthStart(Max({1}Date),-1)), 'Last Month',
'Individual'))))
Dear Ramon,
Thanks for your advice.
It`s working fine now.
Regards
Ronny