Forum Discussion

AleMotta84's avatar
AleMotta84
Frequent Visitor
3 years ago
Solved

Calculate weekly usage of a printer

Hi all,   Every week I receive an email from the printer with an attached csv file which contains the print reports divided for each user. I save this file in a sharepoint folder which is where pow...
  • BA_Pete's avatar
    BA_Pete
    3 years ago

     

    Ah, cool. I should have looked more carefully at your screenshot.

     

    -1- Sort your data by [Data e ora] ascending.

    -2- Add an index column starting from zero and call it [Index0]: Add Column tab > Index Column (dropdown) > 'From 0'

    -3- Add an index column starting from one and call it [Index1].

    -4- Go to the Home tab > Merge Queries. Select the same query as the second table to merge (you're going to merge the table to itself).

    -5- Left Outer merge on Table1[Index0] = Table2[Index1]

    -6- Expand [Data e ora] and [Stampa totale] from the nested merge column.

     

    You now have the previous report date and the previous report meter read on each weekly row, so you can now get the meter change value and the number of days over which this change occurred.

     

    There's a few other tidying bits you'll want to do with column names (Start Date/End Date, Start Read/End Read etc.) but the basic principle of what you need to do is here.

     

    Pete