Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have three list box, for year, month and day.
If the user selects the date, I want to pass that to a variable as vPickDate. And then I want that vPickDate in chart expression. Like select data when vPickDate is greater than Planned Date.
How do I pass the selections made in day, month, and year to one variable and use that in chart.
I appreciate any help
Thanks
Use the MakeDate() to generate date based on the Year, Month and Day.
Ex :vPickDate = MakeDate(Max(Year), Max(Month), Max(Day))
Regards,
Jagan.
Great. Thanks for the reply Jagan
But I want to pass the current selection from the list box to the vPickDate.
How will that work?
Thanks!
vPickDate = MakeDate(Max(Year), Max(Month), Max(Day))
Here Year, Month and Day are the list boxes.
Suppose if you select
Year - 2011
Month - 2
Day - 5
The Max(Year) will fetch 2011 similarly the other will do and by using the MakeDate a date is created.
Regards,
Jagan.
Hi,
The expression Jagan gave you will give you the date of the max values selected for year, month and day, this means that if the user selects more than one value for any of those list boxes, the resulting date will be the max posible date.
If you want to force the user to select just one value for each list box then you can check the option "Always one selected" in the list box properties or you can modify the Jagan's expression to:
MakeDate(only(Year), only(Month), only(Day))
this will give you the date only if one value in each field is selected
Hope this helps
Regards!
Thanks for the reply guys. Gabriela that was a good point.
But when I execute the script using MakeDate(only(Year), only(Month), only(Day))
I get script line error, any idea why we get that and how to fix that.
Where are you using this variable in Script or in Expression of a chart.
Regards,
jagan.
I am creating the variable in the script like
LET vPickDate = MakeDate(only(Year), only(Month), only(Day))
When I run the script I get script line error and so the variable is not created
HI,
try adding a ';' at the end of the sentence or use SET instead of LET
Hope this helps
Thanks Gabriela set worked!