Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script runat="server">
- var dataRows = Platform.Function.LookupOrderedRows('CountsDE2', 'Counts','Hour DESC',['Secret'],[1]);
- if (dataRows && dataRows.length > 0) {
- var today = dataRows[0]["Hour"]; //Sets the most recent date
- var num1 = dataRows[0]["Count"]; //Sets the most recent count entry
- var num2 = dataRows[1]["Count"]; //Sets the previous count entry
- }
- var growthRaw = (num2 / num1) * 100;
- var growth = (growthRaw).toFixed(2) + '%';
- var rows = Platform.Function.UpdateData("CountsDE2",["Hour"], [today],["Growth"],[growth]);
- </script>
Add Comment
Please, Sign In to add comment