Hi,
I want to use for loop in LookML file to do like something below:
I don’t want to write 1, 2, 3 for each same measure.
How can I do this with for loop or somelike for loop in LookML?
Not sure I understand what you are looking to do. The Dimension will be used to create a SQL Statement. So what would that “For Loop” look like in a block of SQL?
However, if you are just looking to create a single Dimension where the result is 1,2 , or 3 depending on the datediff between $[date_date} and getdate().
If so then:
You just need to extend the case statement for the three conditions
OR
Just display the value returned by datediff but you could get values other than 1,2 or 3 depending on the data.
Do you need all the measures to be available at the same time? If not, you could use a parameter and let the person choose the day offset (1,2,3...), if yes, then you have to write each statement. There’s no way to wrap LookML statements in loops
Yes David, I need all the measures to be writable at the same time. It would be nice it was, thanks.