Really simple question about percentage difference (1 Viewer)

Denyial

Registered User.
Local time
Today, 05:45
Joined
Jul 29, 2015
Messages
24
I have a dataset that looks like this:

Cohort Review Number Average Score
1 1 2.39
1 2 4.55
2 1 2.62
2 2 3

I want to run a query that finds the percentage difference between reviews per cohort.

The correct result should look like:

Cohort Percentage Difference
1 +90.4
2 +14.4

My questions are:

How do I set up the query to:
1. Get the correct percentage differences
2. Automatically have the + and - signs for increase and decrease.

Thank you, I'm not struggling with the maths, I'm still very new to Access. Please do let me know if you need any more information that what I've given!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:45
Joined
May 7, 2009
Messages
19,249
(second review - first review)/(first review)

then format it as percent.
 

Denyial

Registered User.
Local time
Today, 05:45
Joined
Jul 29, 2015
Messages
24
Thank you for the formatting, forgot about that.

But how would I build a query to do that? I feel as if I'd need to use a WHERE [Review Number] = 1 but I keep getting errors.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:45
Joined
May 7, 2009
Messages
19,249
SELECT Table1.cohort, FormatPercent((DMax("Average Score","table1","cohort=" & [cohort])-DMin("Average Score","table1","cohort=" & [cohort]))/DMin("Average Score","table1","cohort=" & [cohort])) AS Expr1
FROM Table1
GROUP BY Table1.code;

replace table1 with correct name of your table.
 

Users who are viewing this thread

Top Bottom