0

YES/NO use like to show / hide table element

There is a table where YES/NO we use how to hide show fields for currency exchange rates. This currency rate is displayed in other tables as well. When  we disabled in the main table, it does not disable in other tables. For this we now use "choise" field with formua 

let c := format(Date, "DD.MM.YY");
(select GM)[format(DATE, "DD.MM.YY") = c].VISA = 1

But it doesn't work for for YES/NO field

let c := format(Date, "DD.MM.YY");
(select GM)[format(DATE, "DD.MM.YY") = c]. YES/NO = True

Tell uswhat the problem is

Regards Mamuka

10 replies

null
    • John_Halls
    • 3 yrs ago
    • Reported - view

    Hi Mamuka

    If your code is in the Display field only, if: section

    1. You don't need to format the dates in you code

    2. Your field is probably called 'Yes / No'

    3. The 'Yes / No' field returns 1 for Yes, not TRUE

    4 'Yes / No' = 1 is the same as 'Yes / No'

    So your code becomes

     

    let c := Date;
    (select GM)[DATE = c].'Yes / No'

     

    Do you have a relationship between the tables? If so this can be simplified further.

     

    Regards John

    • iliper LTD
    • iliper_LTD
    • 3 yrs ago
    • Reported - view

    Hello John

    GM is a basic table where information from all tables comes. It is here that the "show hide" button is located and it is called "YES/NO 12"

    • iliper LTD
    • iliper_LTD
    • 3 yrs ago
    • Reported - view

    i tried it doesn't work

     Regards Mamuka

    • John_Halls
    • 3 yrs ago
    • Reported - view

    Can you send me a screenshot of the code. If you can als send a screenshot of the two tables concerned that would help too, plus the Data model (how they are joined together)

     

    Thanks John

    • Alain_Fontaine
    • 3 yrs ago
    • Reported - view

    The select statement returns an array of boolean values, and not a single booelan value as you expect. So you must reduce the array to a single value. How to do it depends on what kind of data is actually contained in the tables. The formula below will return a true result if the "Yes / No" field has the value "Yes" in at least one of the records of the "GM" table where the date has the required value.

    let c := Date;
    max((select GM)[Date = c].'Yes / No')

    • iliper LTD
    • iliper_LTD
    • 3 yrs ago
    • Reported - view

    Thanks Alain

    everything works correctly)

    • iliper LTD
    • iliper_LTD
    • 3 yrs ago
    • Reported - view

    Hello Alain, sorry, but again doesn't work, it doesn't turn off the field in other tables

    • iliper LTD
    • iliper_LTD
    • 3 yrs ago
    • Reported - view

    John

    Code when i use "YES/NO" in table "GM"

     

    Next table name is "CASH DECK" and joined with mine table ( "GM" )like this

     

    for terned field with "YES/NO" im usung cod

    • iliper LTD
    • iliper_LTD
    • 3 yrs ago
    • Reported - view

    Sorry wrog Pic, this pic is correct 

    • John_Halls
    • 3 yrs ago
    • Reported - view

    Hi Mamuka

     

    As with Alain's solution, you need to move this away from an array to a boolean result, so include the max function

     

    max((select GM)[DATE = c].'Yes / No 2')

     

    Regards John

Content aside

  • 3 yrs agoLast active
  • 10Replies
  • 731Views