【问题现象】
如何取科目的借方余额或贷方余额?
【解决方案】
1、科目无辅助核算
100101现金-人民币科目的明细账如下:
QM函数参照设置如下:
即函数QM("100101",月,"借",,,,,,"y","y",,)取值结果为“14463.99”。
QM函数参照设置如下:
即函数QM("100101",月,"贷",,,,,,"y","y",,)取值结果为 空。
2、科目有辅助核算
112201应收账款-人民币科目余额表如下:
如果按照无辅助核算的方法设置
函数QM("112201",月,"借",,,"",,,"y","y",,)取值结果“78701.00”,即客户余额为借方的余额合计:78120.00+581.00=78701.00
如果函数设置时,勾上“按客户编码汇总”
即函数QM("112201",月,"借",,,"",,,"y","y","t",)取值结果仍然是“78701.00”
那么如何设置函数,取112201的借方余额或贷方余额,而不明细到辅助核算呢?
可是使用条件取值函数iff函数来实现
先得出112201科目余额的取值函数(方向选择默认):QM("112201",月,,,,"",,,"y","y",,)
使用iff函数设置取借方余额
逻辑表达式:QM("112201",月,,,,"",,,"y","y",,)>0
条件真值:QM("112201",月,,,,"",,,"y","y",,)
条件假值:0
即函数IFF ( QM("112201",月,,,,"",,,"y","y",,)>0,QM("112201",月,,,,"",,,"y","y",,),0 )取值结果为 空。
使用iff函数设置取贷方余额
逻辑表达式:QM("112201",月,,,,"",,,"y","y",,)<0
条件真值:-QM("112201",月,,,,"",,,"y","y",,)
条件假值:0
即函数IFF ( QM("112201",月,,,,"",,,"y","y",,)<0,-QM("112201",月,,,,"",,,"y","y",,),0 )取值结果为 “146806.14”。