Discussions

 View Only
  • 1.  Combine Fields

    Posted 08-04-2020 17:06
    I want to combine 2 fields for a drop down menu choice. One is a 4 digit numeric field (i.e. 2020).  The other is a Numeric Currency field (i.e. $100,000,000)  How do I combine them? 

    Would like to have it display something like:  2020 Year:  $100,000,000

    ------------------------------
    Mike McCartney
    ------------------------------


  • 2.  RE: Combine Fields

    Posted 08-04-2020 19:01
    try this


    var number Value = Round([Currency]);

    var text Thousands = If(Abs($Value)>=1000,ToText(Int(Abs($Value)/1000)));
    var text Hundreds=Right(ToText(Int($Value)),3);
    var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));

    var text Numbers
    If($value>=1000000,"$" & ToFormattedText($value, "comma_dot"),
    If($Value=0,"$0.00",
    If($Value<0, "- ")
    &
    "$" & List(",",$Millions,$Thousands,$Hundreds)));

    ToText([year]) & " YEAR: " & $Numbers




    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Combine Fields

    Posted 08-04-2020 19:21
    Got an error on Line 8 for:  If($value>=1000000,"$" & ToFormattedText($value, "comma_dot"),
    Error>>"IF" cannot be used as part of a variable name

    ------------------------------
    Mike McCartney
    ------------------------------



  • 4.  RE: Combine Fields

    Posted 08-04-2020 19:30
    I think I was missing an = sign

    this one is tested

    var number Value = Round([Currency]);

    var text Thousands = If(Abs($Value)>=1000,ToText(Int(Abs($Value)/1000)));
    var text Hundreds=Right(ToText(Int($Value)),3);
    var text Millions = If($Value>=1000000,ToText(Int($Value/1000000)));


    var text Numbers =
    If($value>=1000000,"$" & ToFormattedText($value, "comma_dot"),
    If($Value=0,"$0.00",
    If($Value<0, "- ")
    &
    "$" & List(",",$Millions,$Thousands,$Hundreds)));

    ToText([YEAR]) & " YEAR: " & $Numbers

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: Combine Fields

    Posted 08-04-2020 19:45
    Perfect.  Thank you!

    ------------------------------
    Mike McCartney
    ------------------------------