Page 1 of 1

How to write better rules ?

Posted: Wed May 02, 2018 1:11 am
by hoilangthang
Hi all,
I am a newbie, I have a question about how to write better rules. Rule identifier or automap way to write better ?

Case1:
['NhanVienHienHuu','NhanVienNghiepVu']=>DB('KeHoachDinhMuc.TrungGian',!DonVi,'DongPhucNVNghiepVuNam',!PhanLoaiCPNS,'Tong',!Nam,!Thang, PhienBan);
['NhanVienHienHuu','NVNghiepVuDVCap2']=>DB('KeHoachDinhMuc.TrungGian',!DonVi,'DongPhucNVNghiepVuNam',!PhanLoaiCPNS,'Tong',!Nam,!Thang,!PhienBan);
['NhanVienHienHuu','NVNghiepVuDVCap3']=>DB('KeHoachDinhMuc.TrungGian',!DonVi,'DongPhucNVNghiepVuNam',!PhanLoaiCPNS,'Tong',!Nam,!Thang,!PhienBan);

Case2:
[]>DB('KeHoachDinhMuc.TrungGian',!DonVi,!ChucDanh,!PhanLoaiCPNS,'Tong',!Nam,!Thang,!PhienBan);

Best regarads,
LangThang

Re: How to write better rules ?

Posted: Wed May 02, 2018 7:24 am
by orlando
Hi,

i don't like case2 very mutch, because of overfeeding.

When NhanVienNghiepVu, NVNghiepVuDVCap2 and NVNghiepVuDVCap3 are elements of the same dimension you could write


['NhanVienHienHuu',{'NhanVienNghiepVu', 'NVNghiepVuDVCap2', 'NVNghiepVuDVCap'}] => DB('KeHoachDinhMuc.TrungGian',!DonVi,'DongPhucNVNghiepVuNam',!PhanLoaiCPNS,'Tong',!Nam,!Thang,!PhienBan);

For learning rules i recommend the rules guide.
https://www.ibm.com/support/knowledgece ... -gen5.html