Thoughtful Monkey
Thoughtful Monkey

Reputation: 668

How to get correct value of parameter in CDE dashboard sql query?

I have created basic dashboards and looks good till now.

Now I have added parameters for run time analysis. Here is what I did :

  1. Added simple parameter. name = "noofdays"
  2. Created a Select Component, daysselect. added to a panel.
  3. Create a value array. values are : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. corresponding arg is same for array values.
  4. created "sql over sqlJdbc" component. Added all required values. Creates a simple query.
  5. created a bar chart for the query in #4. Worked like a charm
  6. Nof in "sql over sqlJdbc" component, used the parameter like below ("noofdays" is visible in parameters on the

    SELECT `a1`,count(`a2`)
    FROM `app_crd`
    WHERE `a3`='RECV'
    and `a4`='CONDITION'
    and where  DATE_SUB(CURDATE(),INTERVAL ${noofdays} DAY) <= `datecolumn`
    group by `a1`
    

When i check my logs, I see that ${noofdays} return null.

How do i get the correct value?

Thanks Ajay

Upvotes: 2

Views: 7918

Answers (1)

user1749109
user1749109

Reputation: 66

Specify the parameter "noofdays" in the parameter property of the select component "daysselect", and also specify the parameter "noofdays" in the parameter property and in the listener property of the barchart.

Upvotes: 4

Related Questions