I have yet another report I would like help with.
Basically, I want to be able to search on three different parameters if I DON'T have one or the other. The selection expert formula below says that I need to have all 3 parameters (mfrcatnum, lotno, and serialno) to bring back data:
toNumber({caseproitemlist.is_smda}) = toNumber({@smda}) and
{caseproitemlist.consumed_qty} > 0.00 and
((Minimum({?mfrid}) = 0) or {mfr.mfr_id} in {?mfrid}) and
((Minimum({?devtypeid}) = 0) or {devicetype.devicetype_id} in {?devtypeid}) and
{casemain.resunit_id} in {?resunitid} and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{caseproitemlist.surgsuptype_id} = 3.00 and
((Minimum({?serviceid}) = 0) or {casepro.pro_service_id} in {?serviceid}) and
(isnull({caseproitemlist.mfr_cat_num}) or ({caseproitemlist.mfr_cat_num} like {?mfrcatnum})) AND
(isnull({caseproimplant.lotnumber}) or ({caseproimplant.lotnumber} like {?lotno})) AND
(isnull({caseproimplant.serialnumber}) or ({caseproimplant.serialnumber} like {?serialno})) AND
((Minimum({?surgeonid}) = 0) or {casepro.primpract_res_id} in {?surgeonid})
If I change the 'AND' to 'OR' then will I be able to use one or all to narrow my search?
toNumber({caseproitemlist.is_smda}) = toNumber({@smda}) and
{caseproitemlist.consumed_qty} > 0.00 and
((Minimum({?mfrid}) = 0) or {mfr.mfr_id} in {?mfrid}) and
((Minimum({?devtypeid}) = 0) or {devicetype.devicetype_id} in {?devtypeid}) and
{casemain.resunit_id} in {?resunitid} and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{caseproitemlist.surgsuptype_id} = 3.00 and
((Minimum({?serviceid}) = 0) or {casepro.pro_service_id} in {?serviceid}) and
(isnull({caseproitemlist.mfr_cat_num}) or ({caseproitemlist.mfr_cat_num} like {?mfrcatnum})) OR
(isnull({caseproimplant.lotnumber}) or ({caseproimplant.lotnumber} like {?lotno})) OR
(isnull({caseproimplant.serialnumber}) or ({caseproimplant.serialnumber} like {?serialno})) and((Minimum({?surgeonid}) = 0) or {casepro.primpract_res_id} in {?surgeonid})
Is there a better way to do this? Would this work:
If I created a single parameter of {?mfrseriallotno} and then applied this way:
toNumber({caseproitemlist.is_smda}) = toNumber({@smda}) and
{caseproitemlist.consumed_qty} > 0.00 and
((Minimum({?mfrid}) = 0) or {mfr.mfr_id} in {?mfrid}) and
((Minimum({?devtypeid}) = 0) or {devicetype.devicetype_id} in {?devtypeid}) and
{casemain.resunit_id} in {?resunitid} and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{caseproitemlist.surgsuptype_id} = 3.00 and
((Minimum({?serviceid}) = 0) or {casepro.pro_service_id} in {?serviceid}) and
(isnull({caseproitemlist.mfr_cat_num}) or ({caseproitemlist.mfr_cat_num} like {?mfrseriallotno})) or
(isnull({caseproimplant.lotnumber}) or ({caseproimplant.lotnumber} like {?mfrseriallotno})) or
(isnull({caseproimplant.serialnumber}) or ({caseproimplant.serialnumber} like {?mfrseriallotno})) and
((Minimum({?surgeonid}) = 0) or {casepro.primpract_res_id} in {?surgeonid})
Thanks,
Gary
Basically, I want to be able to search on three different parameters if I DON'T have one or the other. The selection expert formula below says that I need to have all 3 parameters (mfrcatnum, lotno, and serialno) to bring back data:
toNumber({caseproitemlist.is_smda}) = toNumber({@smda}) and
{caseproitemlist.consumed_qty} > 0.00 and
((Minimum({?mfrid}) = 0) or {mfr.mfr_id} in {?mfrid}) and
((Minimum({?devtypeid}) = 0) or {devicetype.devicetype_id} in {?devtypeid}) and
{casemain.resunit_id} in {?resunitid} and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{caseproitemlist.surgsuptype_id} = 3.00 and
((Minimum({?serviceid}) = 0) or {casepro.pro_service_id} in {?serviceid}) and
(isnull({caseproitemlist.mfr_cat_num}) or ({caseproitemlist.mfr_cat_num} like {?mfrcatnum})) AND
(isnull({caseproimplant.lotnumber}) or ({caseproimplant.lotnumber} like {?lotno})) AND
(isnull({caseproimplant.serialnumber}) or ({caseproimplant.serialnumber} like {?serialno})) AND
((Minimum({?surgeonid}) = 0) or {casepro.primpract_res_id} in {?surgeonid})
If I change the 'AND' to 'OR' then will I be able to use one or all to narrow my search?
toNumber({caseproitemlist.is_smda}) = toNumber({@smda}) and
{caseproitemlist.consumed_qty} > 0.00 and
((Minimum({?mfrid}) = 0) or {mfr.mfr_id} in {?mfrid}) and
((Minimum({?devtypeid}) = 0) or {devicetype.devicetype_id} in {?devtypeid}) and
{casemain.resunit_id} in {?resunitid} and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{caseproitemlist.surgsuptype_id} = 3.00 and
((Minimum({?serviceid}) = 0) or {casepro.pro_service_id} in {?serviceid}) and
(isnull({caseproitemlist.mfr_cat_num}) or ({caseproitemlist.mfr_cat_num} like {?mfrcatnum})) OR
(isnull({caseproimplant.lotnumber}) or ({caseproimplant.lotnumber} like {?lotno})) OR
(isnull({caseproimplant.serialnumber}) or ({caseproimplant.serialnumber} like {?serialno})) and((Minimum({?surgeonid}) = 0) or {casepro.primpract_res_id} in {?surgeonid})
Is there a better way to do this? Would this work:
If I created a single parameter of {?mfrseriallotno} and then applied this way:
toNumber({caseproitemlist.is_smda}) = toNumber({@smda}) and
{caseproitemlist.consumed_qty} > 0.00 and
((Minimum({?mfrid}) = 0) or {mfr.mfr_id} in {?mfrid}) and
((Minimum({?devtypeid}) = 0) or {devicetype.devicetype_id} in {?devtypeid}) and
{casemain.resunit_id} in {?resunitid} and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{caseproitemlist.surgsuptype_id} = 3.00 and
((Minimum({?serviceid}) = 0) or {casepro.pro_service_id} in {?serviceid}) and
(isnull({caseproitemlist.mfr_cat_num}) or ({caseproitemlist.mfr_cat_num} like {?mfrseriallotno})) or
(isnull({caseproimplant.lotnumber}) or ({caseproimplant.lotnumber} like {?mfrseriallotno})) or
(isnull({caseproimplant.serialnumber}) or ({caseproimplant.serialnumber} like {?mfrseriallotno})) and
((Minimum({?surgeonid}) = 0) or {casepro.primpract_res_id} in {?surgeonid})
Thanks,
Gary