You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/02/21 09:00:33 UTC

[GitHub] [superset] nicovak opened a new issue #18832: Pivot Table V2 - Wrong data for month interval

nicovak opened a new issue #18832:
URL: https://github.com/apache/superset/issues/18832


   Using Pivot Table V2 gives the wrong time interval data for months.
   
   #### How to reproduce the bug
   
   1. Add a pivot table V2
   2. Group data by timestamp and month
   3. The month range has a wrong interval of 1
   
   ### Expected results
   
   The result should be the same as Pivot Table V1
   
   ### Actual results
   
   The data shown for the month is shifted by 1 (February data is shown but in reality, It's march data)
   I think It comes from the header month which is wrong. The data has a good order, but on Pivot table V2 the first month should be removed.
   
   #### Screenshots
   
   - Pivot Table V1 (good)
   
   ![issue-sc-1](https://user-images.githubusercontent.com/6214452/154921656-a0bb49eb-8e05-4717-bc4f-d8735e9710e9.png)
   
   - Pivot Table V2 (bad)
   
   ![issue-sc-2](https://user-images.githubusercontent.com/6214452/154921675-e78d6eea-7974-4ea5-9fac-2bfc1ba11108.png)
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version:
   - superset version: `superset version`
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active:
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [X] I have checked the issue tracker for the same issue and I haven't found one similar.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on issue #18832: Pivot Table V2 - Wrong data for month interval

Posted by GitBox <gi...@apache.org>.
villebro commented on issue #18832:
URL: https://github.com/apache/superset/issues/18832#issuecomment-1047626434


   Thanks for reporting @nicovak - can you post the following:
   - Superset version
   - Database type
   - results from "View Query" for both v1 and v2 charts


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nicovak commented on issue #18832: Pivot Table V2 - Wrong data for month interval

Posted by GitBox <gi...@apache.org>.
nicovak commented on issue #18832:
URL: https://github.com/apache/superset/issues/18832#issuecomment-1055130774


   You're welcome @villebro 
   Here are the answers, sorry for the delay.
   
   - Latest docker tag (just updated now)
   - MongoDB with Trino
   
   I'm pretty sure the issue comes from the dashboard itself, maybe the way month's range is built. It looks like It takes 1 year, but the result is not the same (see my previous screenshots). 
   
   ## Table V1
   
   ```sql
   SELECT company AS company,
          date_trunc('month', CAST(created_at AS TIMESTAMP)) AS created_at,
          count(DISTINCT contact_id) AS "COUNT_DISTINCT(contact_id)"
   FROM
     (SELECT **************.company,
             contact_id,
            **************,
             **************.created_at
      FROM **************
      INNER JOIN ************** ON ************** = **************
      INNER JOIN ************** ON ************** = **************
      WHERE ************** IN('**************',
                          '**************',
                          '**************',
                          '**************')
        AND ************** = true
        AND ************** = false) AS virtual_table
   GROUP BY company,
            date_trunc('month', CAST(created_at AS TIMESTAMP))
   LIMIT 50000;
   ```
   
   ## Table V2
   
   ```sql
   SELECT date_trunc('month', CAST(created_at AS TIMESTAMP)) AS created_at,
          company AS company,
          count(DISTINCT contact_id) AS "COUNT_DISTINCT(contact_id)"
   FROM
     (SELECT **************.company,
             contact_id,
             **************,
             **************.created_at
      FROM **************
      INNER JOIN ************** ON ************** = **************
      INNER JOIN************** ON ************** =**************
      WHERE ************** IN('**************',
                          '**************',
                          '**************',
                          '**************')
        AND ************** = true
        AND ************** = false) AS virtual_table
   GROUP BY date_trunc('month', CAST(created_at AS TIMESTAMP)),
            company
   ORDER BY "COUNT_DISTINCT(contact_id)" DESC
   LIMIT 50000;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org