I've created a table that pulls in HubDB data between 2 date columns;

**{% set exchanged = unixtimestamp(row.exchange_date) %}**

**{% set reservation = unixtimestamp(row.reservation_date) %}**

**{% set exchanged_date = (exchanged - reservation)//24//60//60//1000 %}**

Above calculates the number of days between the 2 column entries.

**{% set total_weeks = (exchanged_date / 7 ) | round %}**

Then I use the number of days and round off to show how many weeks...

**{% for row in table %**}

Answer = **{{ total_weeks }}**

**{% endfor %}**

The above works, but now I want to display a bar graph that shows how many show 4 weeks, 5 weeks, 6 weeks etc. How do I calculate this? I tried the below but it didn't work:

**{% set test1 = (total_weeks, "equalto", "4") | length %}**

Any ideas would be appreciated