Showing posts with label formula. Show all posts
Showing posts with label formula. Show all posts

Saturday, February 11, 2012

"Count" formula giving me a fit!

You guys solved my problem last time so I'm counting on you again! :D

I want to count the number of times the word "CAN" appears on my report. So I wrote a formula that is simply this:

Count (["CAN"])

However, it continually returns the value "1" no matter how many times the word is shown on the report. Like it's a boolean or something.

Don't know if this matters, but the field it is counting up is also a formula. Here is that forumla: If {fieldname}=<-0 then "CAN"

I've tried everything, can you please help??Count (["CAN"]) won't work because it will count the number of array elements, but "CAN" is the only element.

Try creating a new formula
if {fieldname}=<0 then 1

and then creating subtotal for this formula with SUM operation.|||That worked great!! Except my formula couldn't have the = sign directly after the field name.

So my formula is:

if {fieldname}<=0 then 1

Thank you greatly!

Friday, January 27, 2012

doesn't work in LIKE wildcards?

I have table of stocks that includes a varchar field that can optionally hold
a formula. You can identify formulas because the first character is "=". You
can also include the names of other stocks in the formula by surrounding the
ticker in !'s. For instance:
=!MSFT! * 2
I need to find all the formulas that do contain a ticker in them, so that I
can look up the stocks they refer to.
The obvious solution is ... WHERE formula LIKE '=%!'. The obvious solution
does not work. Removing the ! returns all the formulas. Anyone know what
would cause this? ! does not appear in the docs as a reserved word or
wildcard.
MauryHello Maury,
> I have table of stocks that includes a varchar field that can
> optionally hold a formula. You can identify formulas because the first
> character is "=". You can also include the names of other stocks in
> the formula by surrounding the ticker in !'s. For instance:
> =!MSFT! * 2
> I need to find all the formulas that do contain a ticker in them, so
> that I can look up the stocks they refer to.
> The obvious solution is ... WHERE formula LIKE '=%!'. The obvious
> solution does not work. Removing the ! returns all the formulas.
> Anyone know what would cause this? ! does not appear in the docs as a
> reserved word or wildcard.
> Maury
>
I think it's the fact that you didn't add a trailing %
where formula like %!%
Jesse Houwing
jesse.houwing at sogeti.n|||Ohh geez, nevermind!