Hi team, I have been asked to create a table repo...
# gooddata-cloud
r
Hi team, I have been asked to create a table report that uses two filters: 1. Content name (attribute) 2. Hire date (date) The report has one row per employee (user), per content (task). The customer would like to see, in the same visualisation: • Only tasks for selected content values (X,y,z) for users with hire date between 5 to 8 weeks ago • Tasks for ALL content values for users with hire date older to 8 weeks ago. Is there any way to achieve this?
m
Hi Raffaella, I believe this can be achieved with FOR PREVIOUS. It uses the following syntax:
Copy code
SELECT {metric/revenues} FOR Previous({attribute/quarter} , 3)
More details here: https://www.gooddata.com/docs/cloud/create-metrics/maql/time/for-previous/ Please give that a try and let us know how it goes.
r
Hi Moises, I struggle to understand how this would work. Am I supposed to include both parameters in this metric? The report is one row per content, and I need these parameters to filter out certain rows for user / content combination.
m
Could you please send me a direct link to the insight? I would like to take a closer look. TIA.
r
Sure, will DM the report link 🙂
m
Thanks for sending the link, as discussed in our internal conversation, I am afraid that this kind of filtering is something that is not supported by the platform, since filters are applied to the table uniformly, e.g., you cannot say "apply this filter only for rows where X is true, and ignore it when Y is true." One solution is to "hardcode" the filters in as many metrics as you need for the desired date ranges via a MAQL metric (one metric per time range). The downside is that the data would be "static" and the metrics would need to be modified every time a different time range is to be used. Alternatively, you can create two or more insights and apply the desired date ranges.