Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have one table and I am trying to do something like this:
Count(DISTINCT{$<[TIPO_MOVIMENTO]={1},[COD_OPER]={10,11,12,13},[COD_COSSEG_RESSEG]={'null'},[DT_ABERT]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}>} [NUMSINOFICIAL])
+
Count(DISTINCT{$<[TIPO_MOVIMENTO]={0},[COD_OPER]={1,2},[COD_COSSEG_RESSEG]={'null'},[DT_MOVTO]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}>} [NUMSINOFICIAL])
Expression 1 and expression 2 have different filters but are based on the same table. In the second line, I want to count all the NUMSINOFICIAL that are not in the first one.I have been trying including [NUMSINOFICIAL]-=P([NUMSINOFICIAL]) in the second expression, but due to they are the same it is not working.
Any ideas?.... thanks.
Not really sure, What you meant. But, Try a luck
Count(DISTINCT{$<[TIPO_MOVIMENTO]={1},[COD_OPER]={10,11,12,13},[COD_COSSEG_RESSEG]={'null'},[DT_ABERT]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}>} [NUMSINOFICIAL])
+
Count(DISTINCT{$<[TIPO_MOVIMENTO]={0},[COD_OPER]={1,2},[COD_COSSEG_RESSEG]={'null'},[DT_MOVTO]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}, NUMSINOFICIAL = E({<[TIPO_MOVIMENTO]={0},[COD_OPER]={1,2},[COD_COSSEG_RESSEG]={'null'},[DT_MOVTO]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}>} NUMSINOFICIAL)>} [NUMSINOFICIAL])
Or may be this
Count(DISTINCT{$<[TIPO_MOVIMENTO]={1},[COD_OPER]={10,11,12,13},[COD_COSSEG_RESSEG]={'null'},[DT_ABERT]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}>+<[TIPO_MOVIMENTO]={0},[COD_OPER]={1,2},[COD_COSSEG_RESSEG]={'null'},[DT_MOVTO]={'>=$(=Date(vPeriodStart))<=$(=Date(vPeriodEnd))'}>} [NUMSINOFICIAL])
why not write both the expression separately in a straight table and see if both are working and you are getting the sum ?
try it and tell us where it went wrong.
regards
Pradosh