Creating Report with prior year info side by side

Creating Report with prior year info side by side

can someone help me figure out how to create a report (in a table) that shows prior year info in a column next to current year.  I have been able to creat the table/report that i need but now need to have columns of prior year data so i can caluclate variances, etc.  I am guessing I need to create the query in the preparation, but cant figure out how to correlate the information side by side or to build a few output structures that are ten displayed/caluclated side by side..  Would really appreciate any help someone can give.
Hi Jason,

I'm guessing that the information that you want to display is from the same entity, right?

If so, keep in mind that you can add one entity multiple times in the same query. After adding the entity twice, as you seem to need, you will then need to relate them, but seems that you have that figured out already.

After that, you will only need to set the apropriate filter to each entity on your query and you're done! Now use a table records or a list records to show the data.

Pedro Cardoso
I would take this in steps.  First step, get the data side by side.  I would create two web blocks, one for prior year and one for current year.  In the preparation for each web block add the query to get the data you want.  Using the list records widget, show the fields you want to show taking up about half of the screen real estate in each.  Create a web screen with a table in the body that has one row and two columns.  Put each webblock in one of the table cells.  Publish and test. If this works we can figure out the rest of what you want later.

I have not done this, there are no warranties express or implied, use at your own risk, etc.
thank you for the quick rely.  i should have explained a little more/better.  i am building the inital table of info with a query for year A.  I need to show some of the data from Year A - 1 (prior year) which is not read in yet to the query.

Let me see if i can say that differently.  I read all records for year 2011 that has 5 data points ( a,b,c,d,e) that need to be displayed.  I would like to show data point a for 2011 with the corresponding data point a for 2010 next to it and then calculate the variance on data point a for both years, etc.  If my query only gets the 12 rows of data for 2011, how can i in the same table get the 2010 data as well.
Thank you Curt - let me try that concept.  I think I get the idea - and assume if  have the two web blocks - then i can do the calculations accordingly - but will have to play with it.  I wish Outsystems would incorporate their own reporting into the system for these types of reports.  Great system though.  Ill try. thaks again.


check this out

SELECT Year2011.a, Year2011.b, [...] 

         YOUR_ENTITY AS Year2011
          INNER JOIN YOUR_ENTITY As Year2010 ON <Some condition like> Year2011.productId = Year2010.Product Id

     Year2011.Year = '2011' AND
     Year2010.Year = '2010'

Hope it helps...
Pedro Cardoso

Pedro - thank you.

I got that working.  Now just have to figure out how to get it into the rest of the table with all the other data (have like 10 columns).  But that worked nicely - so far. 

I am going to play with that and with Curt's suggestion and see if i can combine them to ge the desired results.

Thank you again - both of you.

Hey Jason  - I've done with both weblocks and separate actions that have input years in the preparation screen.  I've used this for up to 10 years of modeling data with variable inputs for each year.  The latter worked best for me because it was much easier to display the consistent data (like report fields that don't change regardless of year) in the first table and use the output of the other actions in tables that were lined up side by side.   Of course I had to change the block layout to allow for a large landscape.  Hope this helps!