Hello, Is there a way to filter an Insight on two ...
# gooddata-platform
h
Hello, Is there a way to filter an Insight on two different dates? Here I want to show all transasctions of this year by transaction date. For these transactions I want to show the submission date, but not the (empty value) or the 1/1/1900? I wanted to filter them out but it seems that I am not allowed to add another date filter to the filters.
i
Hello Hans, Option to use multiple Date filters is already on our roadmap, however, this seems be bit off to me. You shouldn’t be seeing these unexpected values there really. May I know how did you create or upload this custom date dimension into your workspace, please?
h
Hi Ivana, Good to hear it's coming. Unless I'm mistaken this should be the regular date dimension. Is there some way to check this?
looping @Luis Carriço
✔️ 1
i
I wouldn’t be so sure about it, since it is called “Transaction Date”. The built-in date dimension is simply called Date. You can check it in your logical data model. Also, I’d suggest to run the Project validation to help us reveal potential issues. More info about custom date dimensions can be found here.
h
Okay, the date dimensions have all been replaced by the custom date dimensions because we wanted our customers to be able to use their fiscal year. By default we ship our product with the standard Jan to Dec. Like so: { "dateIntegration": { "file": "/urn_custom_v2_date.csv.zip", "datasets": [ "submissiondate.dataset.dt" , "transactiondate.dataset.dt" , (some more dates) ] } }
I will run the validate project now
The dates have no errors or warnings.
@Ivana Gasparekova The reason that you're doubting the validity, is it the dates with (empty value)?
m
I believe there might have been some misunderstanding, where Ivana assumed there is something wrong with your date dimension assuming that it shows 1900 and empty value within Jan 2023 based on your screenshot. But if I am not mistaken, what your picture really shows, Hans, are actually two different date dimensions (“Transaction Date” and “Submission Date”) in an insight without any metric. So in this case it will just show all the existing combinations of these date dimensions. So I believe there is nothing wrong with your date dimensions. And if the original question was how to filter out specific values (01/01/1900 and (empty value) ) from a date dimension, you currently can not do it with the insight or dashboard filter, but you can still do it within a MAQL metric as if it was a normal attribute:
Copy code
SELECT COUNT(TransactionID) 
  WHERE Date (Submission Date) NOT IN ((empty value), 01/01/1900)
note that even for dates you need to select the values (including the empty value) from the list in the metric editor. And within a metric you can even combine multiple date filters:
Copy code
SELECT COUNT(TransactionID) 
  WHERE 
    Date (Submission Date) NOT IN ((empty value), 01/01/1900)
  AND 
    Year (Transaction Date) = THIS
BTW there is a configuration (disabled by default) to allow metric filtering by a date within the UI (similar to filtering by an attribute). And there you can filter by different date dimension than the whole insight. But this filter only offers positive filter (this year, this week, last week, …) and does not allow you to exclude some dates (empty, 1900 etc).
h
Thanks Michal, it clear to me now. My customer wants to have an overview of all transactions for this year, for transactions that are submitted. 1900-01-01 is bad quality, empty is unavailable and hence should be filtered. I can work around it because I have a flag that tells me if it were submitted or not. I was just trying to find out if 2 dates could be filtered. It's good to know it's on the roadmap. And the last info indeed, we know it's there 🙂 Thanks again!