Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have data like below
I want get get current date and previous date
created variable like below
vCurrentdate = max(date)
vprevdate=max(date,2)
but by default it is giving 2nd value, if i select something from date it will be null like below
the value should be 2024-06-28 after selecting 2024-06-30.
thanks in advance
Please help me to achieve this
Regards,
Saritha.
Try :
=if(GetSelectedCount(Date)=0, Date(max(Date,1), 'YYYY-MM-DD'), Date(Max({<Date = {"<$(=Only(Date))"}>} Date), 'YYYY-MM-DD'))
you can store 1st part from if() statemnt in vCurrentdate and 2nd part in variables.
if not, you can use entire if statemtn in vCurrentdate.
By default when there no selections, it shows max available date:
if a date is selected, it shows the previous max date to the selected date:
@Saritha077 try below expression for previous date variable
max({<Date = {"<$(=max(Date))"}>}Date)
Hi @Saritha077 ,
Your MAX() expressions work on your active selections. No selection for your MAX() means all values available.
If you select one date, the max is applied on ONE value. So, it's normal to get a NULL from your second expression. You have to select at least two values if you want a result for your second expression.
Regards.
Try :
=if(GetSelectedCount(Date)=0, Date(max(Date,1), 'YYYY-MM-DD'), Date(Max({<Date = {"<$(=Only(Date))"}>} Date), 'YYYY-MM-DD'))
you can store 1st part from if() statemnt in vCurrentdate and 2nd part in variables.
if not, you can use entire if statemtn in vCurrentdate.
By default when there no selections, it shows max available date:
if a date is selected, it shows the previous max date to the selected date:
@Saritha077 try below expression for previous date variable
max({<Date = {"<$(=max(Date))"}>}Date)
Both are working fine
thanks alot
regards,
Saritha