Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Topic: IF x then x with count Posted: 16 May 2017 at 5:25am
Using Crystal 2013 - v 14.1.7.1853
I have been trying to move my ( ) around, can't figure out what I am doing wrong on this formula. Then it dawned on me, can I actually do a count combining the IF statement else like I am trying to do?
numberVar totCount01;
if {@Work Days} > 2 and ({GENERIC_VW.USER_DEF2} = "TRUE") then
totCount01:= totCount01 + 1;
else
if {@Work Days} > 3 and ({GENERIC_VW.USER_DEF2} <> "TRUE") then
totCount01:= totCount01 + 1;
totCount01;
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 16 May 2017 at 10:54am
if you are trying to get two distinct counts no you cannot do it this way, you need two distinct sets of formula to return distinct results. Or create two running totals with two different evaluate formulas.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 17 May 2017 at 7:51am
Or if you have two global/shared variables, you can do two different counts in a formula. If and when you may want to reset the values will require a separate formula. And you would need two formulas (one for each variable) to display the values.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum