0

Show two tables in one view

Hi there - has any body tried to do this and how will it be done ?

 

The case is that I have a table for purchases (Danish name "Indkøb") An a table for Sales (Danish "Salg"), and I want to show them in the same view so I can make a graph showing the progress in the inventory for each article.

I guess I have to create a Phantom table containing fields Fram both tables - the inventory I created is taken from the official template in Ninox with some changes which suits my needs, but the data structure is quite the same. 

rgds

Leo

6 replies

null
    • szormpas
    • 1 mth ago
    • Reported - view

     Hi, could you create a small demo database with just the two tables and the type of relationship between them?

      • Leo_Woer
      • 1 mth ago
      • Reported - view

       

      Hi Sotirios, it will be be complicated only to send you the two tables, so I provide you with the whole DB

      And as stated it is very alike to the official template, but with som changes here and there, and off course translated to Danish.

      Thanks for your interest - hope you can understand the DB ebven if it is Danish,

      rgds

      Leo

      • szormpas
      • 1 mth ago
      • Reported - view

        Hi,

      The relationship between the 'Indkob' and 'Salg' tables is N:N via the '3_Varer' table.

      I've created a view in your dashboard for the table "3_Varer". This gives you access to both the 'Indkob' and 'Salg' tables.

      Is this what you are looking for?

      • Leo_Woer
      • 1 mth ago
      • Reported - view

       

      Hi Sotirios

      No this is exactly what I was able to do myself - the view must be one view to be able to create a graph, which shows the development in both purchases and sales in the same graph.

      That is why I think I have to create a phantom database. Anyway thanks a lot until now.

      rgds

      Leo

      • szormpas
      • 1 mth ago
      • Reported - view

        Hi,

      I haven't used Ninox native charts much myself. But if you want to be able to create a dataset and present it with nice charts in a way that gives you lots of freedom, you might want to think about integrating an external library like eCharts.

      You'll find some useful info in the "Statistics" section of the Dashboard Template project.

    • Leo_Woer
    • 1 mth ago
    • Reported - view

    Hi Sotirios

    promised to get back to you - I created a Phantom table and use this script in a button in the Dashboard - and it works. (off course when I place this in the cloud I will do the script with "do as server". Right now I have it on my Mac.

    delete (select Lagerhistorik);
    for j in select 'Indkøb' do
        let Xdato := j.'Ordre hos leverandør'.Leveringsdato;
        let Xordre := j.'Ordre hos leverandør'.'Ordre Nr.';
        let Xantal := j.'Antal i ordre';
        let Xvnr := j.Vare.'Vare Nr.';
        let Xvnvn := j.Vare.Varenavn;
        let Xdel := j.Delleverance;
        let Xstatus := j.'Ordre hos leverandør'.'Ordre status';
        let Xremark := j.'Ordre hos leverandør'.'Bemærkninger';
        let Xid := (create Lagerhistorik);
        Xid.(
            Dato := Xdato;
            'Købsordrenr' := Xordre;
            'Vare Nr.' := Xvnr;
            'Antal købt' := Xdel + Xantal;
            'Vare navn' := Xvnvn;
            Status := Xstatus;
            'Bemærkninger' := Xremark
        )
    end;
    for j in select Salg do
        let Xdato := j.Salgsordrer.'Faktura dato';
        let Xordre := j.Salgsordrer.'Faktura Nr.';
        let Xantal := j.Antal;
        let Xvnr := j.Vare.'Vare Nr.';
        let Xvnvn := j.Vare.Varenavn;
        let Xstatus := j.Salgsordrer.Kunde.Status;
        let Xremark := j.Salgsordrer.Kunde.'Bemærkninger';
        let Xid := (create Lagerhistorik);
        Xid.(
            Dato := Xdato;
            Fakturanr := Xordre;
            'Vare Nr.' := Xvnr;
            'Antal solgt' := Xantal;
            Status := Xstatus;
            'Bemærkninger' := Xremark;
            'Vare navn' := Xvnvn
        )
    end

    Now I will investigate the E-chart and your version 5 of the Dashboard, as I agree with you that the native graphs in Ninox could be better.

    Thanks for your help

    Regards

    Leo

Content aside

  • 1 mth agoLast active
  • 6Replies
  • 63Views
  • 2 Following