strange behavior of the sum function
Posted: Wed Jan 17, 2018 8:18 am
in my report I insert a total textbox (in footer band) which contains this code:
{Sum(Switch(SourceData1.NAME != "" & SourceData1.NAME1== "" & SourceData1.NAME2 == "",SourceData1.AMOUNT,
SourceData1.NAME != "" & SourceData1.NAME1 != "" & SourceData1.NAME2 == "",SourceData1.AMOUNT/2,
SourceData1.NAME != "" & SourceData1.NAME1 != "" & SourceData1.NAME2 != "",SourceData1.AMOUNT/3))}
(the code Sum the division the amount by the number of users. If they are two users, divide by two, if they are three users, divide by three, if only one user does not divide).
But the result of the sum is often not good.
Why this ?
Is there another way to make this sum ?
Many Thanks for help
{Sum(Switch(SourceData1.NAME != "" & SourceData1.NAME1== "" & SourceData1.NAME2 == "",SourceData1.AMOUNT,
SourceData1.NAME != "" & SourceData1.NAME1 != "" & SourceData1.NAME2 == "",SourceData1.AMOUNT/2,
SourceData1.NAME != "" & SourceData1.NAME1 != "" & SourceData1.NAME2 != "",SourceData1.AMOUNT/3))}
(the code Sum the division the amount by the number of users. If they are two users, divide by two, if they are three users, divide by three, if only one user does not divide).
But the result of the sum is often not good.
Why this ?
Is there another way to make this sum ?
Many Thanks for help