Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2700
UltraWinGrid and running total column
posted

I have a Grid which displays a column with a distance in it and I want to display a running total of that distance.  this proved easy as there is a great example online and I added the formula as suggested and it all works.  My formula is as per the example.

[Distance] +

if
(
iserror ( [RunningTotalNew1(+1)] ),
0,
[RunningTotalNew1(+1)]
)

The issue I have is that this sums up for EVERY [Distance] cell which is not entirely correct.  I have a second column which contains a string value and I only want to add [Distance] if the column ([Session]) contains a value.  Sure it can be done but I am having problems understanding the formula builder.

  • 469350
    Offline posted

    Sound like you just need ato add a second condition to your 'if' statement. 

    What's the DataType of the Session column? What exactly does "contains a value" mean here. Will it be null? Or 0? Or an empty string? 

    Depending on which one your blanks will be, you could use a function like 'isdbnull', 'isblank', or 'isnull'.

    Then you want to logically OR that together with your current check for isError. So if it's an error OR a blank, you want to add 0. 

    So it would look something like this: 

    [Distance] +

    if
    (
    or( iserror ( [RunningTotalNew1(+1)]), isblank( [Distance] )),
    0,
    [RunningTotalNew1(+1)]
    )