Forum Discussion

JESUSCRUZ's avatar
JESUSCRUZ
Qrew Member
2 years ago

Can I store an if evaluation in a variable?

Hello community,

What I am trying to do is the following: 
I have a main table that I use to build reports using queries within quickbase, in this scenario what I need to do is to evaluate if my project manager (let's say) Joe Black who has a Principal title appears in my query at least once, that way I can identify if Joe is indeed Principal and has one or more projects or the opposite.

The part of the code that is not working is the evaluation part, and specifically because I can't store the logical result into a variable. I have verified and evaluated step by step the counting from my query and their conditions and it works perfectly except for this part:

var number PrincipalJoeBlack=
ToNumber(

If(

$CountPrincipalJoeBlack>=1, 1

));


Which result for the variable PrincipalJoeBlack is 0 (although the condition is true)
Don't know if there is a better way to do this kind of lookup with very specific conditions and cases without using if, I know there is no formula to identify unique values in QuickBase at the moment and that's why I am building an iterator.
PS: I also tested the if condition without ToNumber function and same happens.

Hope you can help me and thank you in advance.


------------------------------
JESUS CRUZ
------------------------------
  • The likely problem is that 

    $CountPrincipalJoeBlack

    is not what you assume it is.  I suggest you just adjust the formula or make a new formula to see what's actually in that field.

    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • JESUSCRUZ's avatar
      JESUSCRUZ
      Qrew Member
      Thank you, Mark, I will verify the conditions in an isolated scenario and see if I am getting what I am supposed to. 

      Will let you know what it was.

      ------------------------------
      JESUS CRUZ
      ------------------------------