Creating Custom Dimension on Date Attribute in Looker Explorer

I have a dataset which is exposed in Looker Explorer and it has few attributes like -

1. Period Date

2. Input Source (Values are: Current, Future)

The data coming for Current & Future use the same attribute 'Period Date' to store the data. So I use Input Source as default filter in the filter section to select the input source. The Period Date values can contain same date for Current and Future input source and there will be future dates for Future Input Source.

I want to create a Custom Dimension where I can only see the dates that belong to Future Input Source, so that I can use that Custom Dimension to select only those dates which I need. Currently I cannot exculude dates based on Input Source. 

Example:

CurrentFuture
2023-01-312023-01-31
2023-02-282023-02-28
2023-03-312023-03-31

I want to create filter where I need data for Current for all the three dates but for Future I only need the data for the date 2023-03-31 only.

I tried creating custom dimension using if/case statements, but couldn't achieve what I am looking for. Any thoughts/guidance is much appreciated.

0 1 33
1 REPLY 1

If you want to create a custom dimension to only include dates that come from the Future Input Source rows, you can use this expression. Hope this helps!


case(
when(
${view_name.input_source} = "Future", ${view_name.period_date}
),
null
)

Top Labels in this Space