Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I was wondering if it was possible to pass values to variables based on selections .
For eg. If I select a Year= 2010, the variable vDate should store the value 01/01/2010.
If I select Year= 2010 and Month=7, the variable vDate should store 07/01/2010.
It would be extremely helpful if someone could provide a solution.
Thanks,
Neeraj
You can use a GETFIELDSELECTIONS(your_field) function!!!
For more details...look a help from QV!!!
go to variable overview and make a variable like:
makedate([Year],[Month],[Day])
Which assumes you also have a [Day] field but if not just put 1 instead of day
There could be some issues like if you have more than one year or month selected in which case it isn't going to return anything. I could never figure out how to make that case work but it has something to do with concat I think...
You can define vDate to be:
=Only(Year)
In this case you have the year in vDate once you select only one Year.
You can also use other options depending what you really need to have in your variable.
Example if you define your variable to be:
=Only(Makedate(Year,1,1) )
you will have the first day of earch year. Example: 2010-01-01 whe you select only 2010.
Hi Erico, Trent,
Thank you very much for helping me out.
I think get field selections function will help me to deal with multiple selections as well.
Thanks,
Neeraj
Hi Patricio,
Thank you very much. A combination of the above 3 solutions should serve my purpose well. Will get back if I face hiccups.
Thanks,
Neeraj