I'm quite new to GDS and I've been experimenting with the comparison date range to see the increase in % between current and previous month
I've managed to get a slight result but it's not showing the correct % increase which I have manually calculated to confirm.
The values are
No of Reviews (calculation)
July - 379 reviews / 314 positive reviews = 82.85%
August - 480 reviews / 458 positive reviews = 95.42%
Manually Calculated Difference = 12.57%
GDS Comparison Difference = 15.2%
The date column itself is formatted as "YYYYMMDD" and I've tried the comparison and calculation field options on the metric but to no avail
It feels like I am getting a comparative % rather than a direct increase
Any help/guidance would be greatly appreciated as I have tried the GDS forum several times but there is very little activity on there
Thanks so much
Dan
It's not ideal but to do this in GDS you need to create a new column in Google Sheets which is literally the values you need from the previous month. I.e.
date |reviews|pos reviews|prev month reviews|prev month pos reviews|
2019-08-01|480 |458 |379 | 314 |
You can then create 2 calculated fields for this month % positive and last month % positive and a 3rd for the difference.
There are other wyas you can try to do this but they get a bit messy and manual so that's probably a good starting point. GDS is great in some ways (cost being one!) but a little limited in others!
On the style on your table, under show compare, check Show Absolute Change to get the exact difference.
Related
I am new in Power BI, and I am struggling with how to resolve an issue.
I made measures to calculate my total feedback. The feedback column can be POS, NEG, and Neutral. The overall sentiment I calculated by taking pos feedback and dividing by all feedback.
totalFeedback = CALCULATE(COUNTROWS('feeback'),'feedback'[sentiment] = "POS")/ COUNTA('feedback'[sentiment])
Now when I want to calculate the difference between two months. Example today's, and last month I get an error saying duplicates dates.
difference = CALCULATE([totalFeedback], DATEADD(FILTER('comment'[created_at], 'comment'[created_at] < TODAY()),-1,MONTH)
I get an error saying: A date column containing duplicate dates was specified in the call to function 'DATEADD'. This is not supported
What I did was I created a DATE TABLE and made a relationship with the comment[created_at].
DimDate= CALENDARAUTO(12).
Now, I don't get the error anymore, but non of the data is shown when adding the measure in the table.
I need advice, thanks
in Salesforce, how to create a formula that calculate the highest figure for last month? for example, if I have an object that keeps records that created in Sept, now would like to calculate its max value (in this case, should be 20 on 3/8/2019) in last month's (August). If it's in July, then need to calculate for June. How to construct the right formula expression? Thanks very much!
Date Value
1/9/2019 10
1/8/2019 14
2/8/2019 15
3/8/2019 20
....
30/8/2019 15
You can't do this with normal formulas on records because they "see" only current records (and some related via lookup), not other rows in same table.
You could make another object called "accounting periods" or something like that. Link all these entries to periods (months) in master-detail relationship. You'll then be able to use rollup summary with MAX(). Still not great because you need lookup to previous month to pull it but should give you an idea.
You could make a report that achieves something like that. PREVGROUPVAL will let you do some amazing & scary stuff. https://trailhead.salesforce.com/en/content/learn/projects/rd-summary-formulas/rd-compare-groups Then... if all you need is a report - great. If you really need it saved somewhere - you could look into reporting snapshots & save results in helper object...
If you want to do it without any data model changes like that master-detail or helper object - you could also write some code. Nightly batch job (running daily? only on 1st day of month?) should be pretty simple.
Without code - in a pinch you could make a Flow that queries records from previous month. Bit expensive to run such thing for August every time you add a September record but if you discarded other options...
I am trying to get a count of all Unique values listed in Col A, by state and within a date range, for example all records up to the end of April 2018.
I am able to get the count of Unique values by state (result is 2) with the below formula:
{=SUMPRODUCT(1*(FREQUENCY(IF($C$2:$C$14=F10,MATCH($A$2:$A$14,$A$2:$A$14,0)),ROW($A$2:$A$14)-ROW($A$2))>0))}
but I am unable to get the IF function to work with EDATE. I tried the following but I'm getting 0 as the result. The result should be 1.
{=SUMPRODUCT(1*(FREQUENCY(IF(D2:D14="<"&EDATE(G1,1),IF($C$2:$C$14=F10,MATCH($A$2:$A$14,$A$2:$A$14,0))),ROW($A$2:$A$14)-ROW($A$2))>0))}
I am unable to use Pivot as I need to include date range filter. Could someone please look at my code and tell me what I'm doing wrong? I am using CSE with my formulas. Thankyou!
I managed to work it out. EDATE wasn't working so I entered the Month date in cell:G1 then referenced it in the IF formula using "<=" eg: IF(D2:D14<=G1).
Whole array formula is:
`{=SUMPRODUCT(1*(FREQUENCY(IF(D2:D14<=G1,IF($C$2:$C$14=F10,MATCH($A$2:$A$14,$A$2:$A$14,0))),ROW($A$2:$A$14)-ROW($A$2))>0))}
I now receive the correct count of 1, though I have to ensure I have entered the last day of the Month in G1. State is referenced in F10 and count of unique values is in Column A.
My full data set is sourced from multiple documents over 5000 rows each and growing daily so my workbook is quite slow to calculate over 1000 array formulas... but it works!
If anyone knows of a faster (possibly non-array) formula, I would appreciate the advice! Thanks!
I am pulling Facebook Fan data daily via Supermetrics into Data Studio and I was hoping someone could share a formula that I could use to calculate New Fans, as a calculated field, from Total Fans.
The formula would need Identify the last day of the month and the subtract followers from the first day of the month.
For example: If there 100 Fans at the end of September and 60 Fans at the beginning September, the formula would show 40 New Fans.
Formula Example
Assuming the net fan numbers is always increasing, first set the aggregation method for Total Fans to None in Fields screen by editing the data source. Then you can create a new calculated metric with the formula max(Total Fans)-min(Total Fans). This will work only at aggregate level (using scorecard or table total) and not at row level in tables.
I have a system where people can pick some stocks and it values their portfolios but I'm having trouble doing this in a efficient way on a daily basis because I'm creating entries for days that don't have any changes(think of it like I'm measuring the values and having version control so I can track changes to the way the portfolio is designed).
Here's a example(each day's portfolio with stock name and weight):
Day1:
ibm = 10%
microsoft = 50%
google = 40%
day5:
ibm = 20%
microsoft = 20%
google = 40%
cisco = 20%
I can measure the value of the portfolio on day1 and understand I need to measure it again on day5(when it changed) but how do I measure day2-4 without recreating day1's entry in the database?
My approach right now(which I don't like) is to create a temp entry in my database for when someone changes the portfolio and then at the end of the day when I calculate the values if there is a temp entry I use that otherwise I create a new entry(for day2-4) using the last days data. The issue is as data often doesn't change I'm creating entries that are basically duplicates. The catch is: my stock data is all daily. I also thought of taking the portfolio and if it hasn't been updated in 3 days to find the returns of the last 3 days for each stock but I wasn't sure if there was a better solution.
Any ideas? I think this is a straight forward problem but I just can't see a efficient way of doing it.
note: in finance terms, its called creating a NAV and most firms do it the inefficient way I'm doing it but its because the process was created like 50 years ago and hasn't changed. I think this problem is very similar to version control but I can't seem to make a solution.
In storage terms is makes most sense to just store:
UserId - StockId1 - 23% - 2012-06-25
UserId - StockId2 - 11% - 2012-06-26
UserId - StockId1 - 20% - 2012-06-30
So you see that stock 1 went down at 30th. Now if you want to know the StockId1 percentage at the 28th you just select:
SELECT *
FROM stocks
WHERE datecolumn<=DATE(2012-06-28)
ORDER BY datecolumn DESC LIMIT 0,1
If it gives nothing back you did not have it, otherwise you get the last position back.
BTW. if you need for example a graph of stock 1 you could left join against a table full of dates. Then you can fill in the gaps easily.
Found this post here for example:
UPDATE mytable
SET number = (#n := COALESCE(number, #n))
ORDER BY date;
SQL QUERY replace NULL value in a row with a value from the previous known value