create dynamic measures with parameter selcted date by user

Hello,

I would like to create measures with parameters allowing the user to choose the date (month and year) that he wants to display the sales data of month N / Year N and month N-1 / Year N-1 This is what i do


measure: Nb_de_jours_mois_N {
    type: count_distinct

    sql: ${TABLE}.VENTE ;;
    filters: [dte_vente_date: "last month"]
  }

  measure: Nb_de_jours_mois_N_1 {
    type: count_distinct
    sql: ${TABLE}.VENTE ;;
    filters: [vente_date:"13 months ago"]
  }

But I want it to display according to the date entered in the date filter.

Thanks

Solved Solved
0 7 656
1 ACCEPTED SOLUTION

@tatuspark I had a similar requirement recently and found the solution in this article: https://help.looker.com/hc/en-us/articles/360001286007-Creating-Filtered-Measures- 

View solution in original post

7 REPLIES 7
Top Labels in this Space