0

Need Formula on Chart

I have a multiple selection dynamic

let uni := unique(((select Gastos) order by Categorias).text(Categorias));
for i in uni do
    first((select Gastos)[text(Categorias) = i])
end

 

Copy

 

I need the Formula on Chart, so that once I select an option on MCd, it show me the values of that option.

I use this but don't Work 

for i in numbers(MCd) do
    record(Gastos,i)
end

4 replies

null
    • Fred
    • 6 mths ago
    • Reported - view

    What kind of field is Categorias in Gastos?

    The way you created your Categorias dynamic multichoice field is an interesting way of doing it. The one thing I see is dynamic choice fields are based on table records so at the root of the field is a record Id. You asked Ninox to create a dynamic field based on the first instance of a record that has that Categoria.

    You may want to create a Categorias table that has just one record for each categoria. Also as your Gastos tables grows it will slow down the creation of this dynamic choice field.

    For the second part:

    I'm guessing you want to find all records in Gastos that have matching selection in Categorias with the selection in MCd?

      • Rafael Sanchis
      • Rafael_Sanchis
      • 6 mths ago
      • Reported - view

       Hi Fred.

      The Categorias in Gastos is Choice field. 

      Yes I Have a Categories Tables.

      The Second is yes.

    • Fred
    • 6 mths ago
    • Reported - view
     said:
    Yes I Have a Categories Tables.

    May I ask why you don't use it as the base for your dynamic field? It would mean you would probably want to change Gastos.Categorias as well, but to standardize around the same categories will make things easier in the long run.

     said:
    The Second is yes.

    Maybe you can do something like this in a formula field:

    let x := for loop1 in numbers(MCd) do
            let getRec := record(Gastos,loop1);
            getRec.text(SimpleChoice)
        end;
    let a := (select Gastos)[var suba := text(Categorias);
            count(x[= suba]) > 0];
    concat(a)
    

    You can verify if the correct records are being selected as you make your selection. Of course if you change the root table of your dynamic fields then the code will have to change.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 6 mths ago
      • Reported - view

       I'm going to review your formula, today I'm complicate, and I will review the formula that I have in my Project Database in which it works fine.

      In the This chart works great when click on MCd the graphics change.

Content aside

  • Status Answered
  • 6 mths agoLast active
  • 4Replies
  • 68Views
  • 2 Following