Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am loading one table where i want to provide a condition that :
(1) IF User select Type = Booking than booking filter should add with where condition
(2) If user select Type = Arrival than arrival filter should Add with where condition
Type is a field having 2 values ' Booking' and 'Arrival'
variables are given below:
vBooking =([Booking Year] >= $(vBookingFromYear) and [Booking Year] <= $(vBookingToYear));
vArrival = Date([Arrival Date],'DD/MM/YYYY') >= Date(Addmonths(Today(),-4),'DD/MM/YYYY') and Date([Arrival Date],'DD/MM/YYYY') <= Date(Today(),'DD/MM/YYYY') ;
Script is given below:
booking_f:
LOAD [Booking WID],
[Person WID]
FROM
$(vQvdFileLocation)booking_f.qvd
(qvd)
//WHERE([Booking Year] >= $(vBookingFromYear) and [Booking Year] <= $(vBookingToYear))
//and Date([Arrival Date],'DD/MM/YYYY') >= Date(Addmonths(Today(),-4),'DD/MM/YYYY') and Date([Arrival Date],'DD/MM/YYYY') <= Date(Today(),'DD/MM/YYYY') ;
where
Pick( Match ( Type, 'Booking', 'Arrival')
,'$(vBooking)','$(vArrival)');
Please suggest ................the possible solution
Hi,
Create a variable like vType and definition as =GetFieldSelections(Type). So when the user selects "Booking" or "Arrival", it will be stored in the variable. Then you can use the variable in the script.
booking_f:
LOAD [Booking WID],
[Person WID]
FROM
$(vQvdFileLocation)booking_f.qvd
(qvd)
where
Pick( Match ( '$(vType)', 'Booking', 'Arrival')
,'$(vBooking)','$(vArrival)');
Edit: Create the variable in front end. See the screenshot.
After select the listbox, you can use the script to reload the data.
I think you need this selection during loading, you can do this with input fields (look in the help) but I do not suggest this way, It should be better to load everithing then filter the result through a variable.
let me know