0

Dynamic Reports - Data from Different tables

Another question: Is it possible to call data from two different unrelated tables to fill the report?

Like this:

let xFilter := record(Reports,1).Filter;

let x := (select Payroll where 'Month Ending' = xFilter);

let y := (select 'Business Details' where Id = 1);

x.{

Month_End: format('Month Ending', "DD/MM/YYYY"),

Employee: text('Select Employee'),

Gross: Gross,

WIT: 'Gov Tax',

SS_Employee: 'Employee Contribution',

SS_Employer: 'Employer Contribution'

};

y.{

Biz: 'Business Name'

}

I find that x data stops being added only the y data is visible on the report

3 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 3 days ago
    • Reported - view

     I think this would work....

    First you need to put the y formula in a first() function. Then call the y inside the x.{

    let xFilter := record(Reports,1).Filter;

    let x := (select Payroll where 'Month Ending' = xFilter);

    let y := first((select 'Business Details' where Id = 1));

    x.{

    Month_End: format('Month Ending', "DD/MM/YYYY"),

    Employee: text('Select Employee'),

    Gross: Gross,

    WIT: 'Gov Tax',

    SS_Employee: 'Employee Contribution',

    SS_Employer: 'Employer Contribution',

    Biz: y.'Business Name'

    };

    • Fred
    • 3 days ago
    • Reported - view

    Just a bit of background. Ninox only outputs the last line, command. So you last command is the JSON that shows the y data. That is why  recommended that you put the y data into the x JSON. 

    • Michael_Riley
    • 2 days ago
    • Reported - view

    Thank you   and

    What a great community.

Content aside

  • 2 days agoLast active
  • 3Replies
  • 23Views
  • 3 Following