Hello I am trying to compare some data (sales) be...
# gooddata-cloud
c
Hello I am trying to compare some data (sales) between a custom defined period 1 and a custom defined period 2. Is there a workaround to do it?
m
Hi Clement, comparing data between two custom-defined periods within a single visualization is not natively supported using two date filters on the same date dimension. The platform allows you to add multiple date filters, but each must correspond to a distinct date dimension. You cannot apply two different filters to the same date dimension in a single insight or dashboard to compare two arbitrary periods side by side. Comparisons of data across different time periods can only be conducted using the primary (leftmost) date filter in the visualization, and the built-in “Compare the period with” option is limited to previous period or same period last year, not two arbitrary custom periods. More details can be found here: Visualization Date Filters If I have misunderstood your issue. Please provide more details on your use case and provide are more complete overview of the issue you’re facing.
m
a few ideas that come to my mind: • if it is in Analytical designer, you can add separate date filter to each metric in the UI (though this metric-specific date filter is somehow limited in what period you can select there • alternatively as a workaround: ◦ you could have two different date dimensions in your data model (let's say Date A and Date B) connected to the same dataset ◦ then create two metrics:
SELECT x WITH PF EXCEPT {label/DateA.day}
and
SELECT X WITH PF EXCEPT {label/DateB.day}
◦ then use these two metrics in a visualization together and use Date filters A and B. One metric will ignore date filter A, the other will ignore Date filter B
c
Thanks @Michal Hauzírek. I will test it. In the analytical designer, how can I link a metric to a specific date filter?
m
When you drag the metric to the bucket, there is this “Filter by Date” option between the metric name and the format. Once clicked, you can select which date to use for filtering and what period to filter. But there are only pre-defined periods and you can not choose your own. But if those are OK for you, you can even drop the same metric multiple times and filter each by a different date filter.