Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have created an variable in script but it is showing an script error,but i have tested the same in text object its working fing fine.
Please find the below error.
Variable : let vCurr_Month_Year = month(monthstart(max(ActivityDate-1)))&' '&(year(max(ActivityDate-1)));
Thanks..
Yes it would work in the UI but not in the script. Let me explain why. The problem is max() in your expression. You can't use any field using aggregation function in variable declaration in the script like that. They can only be used in a load statement.
You may rather try something like:
Load
Max(AcivityDate) as MaxDate
From <>;
Let vMaxDate=Num(Peek(MaxDate))-1;
let vCurr_Month_Year = month(monthstart($(vMaxDate))&' '&(year($(vMaxDate)));
Edit: Corrected the field name
What is your intend to show?
May be try with SET instead of let:
SET vCurr_Month_Year = month(monthstart(max(ActivityDate-1)))&' '&(year(max(ActivityDate-1)));
Hi Naresh,
Activate date is not use directly in let function.
do one thing
create two variables in front end:
vA1=month(monthstart($(vMax))-1);
vA2= year(date($(vMax)))-1;
Then open text box object use below expression
=vA & vB
It will working fine
Thanks
Gireesh
This function also not working...
Hi,
I think set wont help.
Thanks..
I have corrected the field name in the post above. Now give a try.
Create three variables in front end using variable overview
vA=month(monthstart($(vMax))-1);
vA= year(date($(vMax)))-1;
vCurr_Month_Year =vA & vB
Then open text box object use below expression
=vCurr_Month_Year
working fine in my system
Hi,
What is vMax ?
Thanks..