Number of visits over the last 90 days

Chart type: Scorecard

WITH tab1 AS(SELECT
id,
EXTRACT(DAY FROM timestamp - NOW()) as diff,
place_id
FROM log
WHERE action_code='CHECK_IN')

SELECT
COUNT (DISTINCT id) as nb_submissions
FROM tab1
WHERE place_id = '$param1$' AND diff<91
CODE

Number of visits over the last 30 days

Chart type: Scorecard

WITH tab1 AS(SELECT
id,
EXTRACT(DAY FROM timestamp - NOW()) as diff,
place_id
FROM log
WHERE action_code='CHECK_IN')

SELECT
COUNT (DISTINCT id) as nb_submissions
FROM tab1
WHERE place_id = '$param1$' AND diff<31
CODE