Skip to content

Commit

Permalink
chore: Backport #4903 to web (#4908)
Browse files Browse the repository at this point in the history
Co-authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
  • Loading branch information
prql-bot and corneliusroemer authored Sep 14, 2024
1 parent 57d6948 commit c5875a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/website/data/examples/expressions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ label: Expressions
prql: |
from track_plays
derive {
finished = started + unfinished,
finished = started - unfinished,
fin_share = finished / started, # Use previous definitions
fin_ratio = fin_share / (1-fin_share), # BTW, hanging commas are optional!
}
sql: |
SELECT
*,
started + unfinished AS finished,
(started + unfinished) / started AS fin_share,
(started + unfinished) / started / (1 - (started + unfinished) / started)
started - unfinished AS finished,
(started - unfinished) / started AS fin_share,
(started - unfinished) / started / (1 - (started - unfinished) / started)
AS fin_ratio
FROM
track_plays

0 comments on commit c5875a3

Please sign in to comment.