Incorrect data in dynamic view

Hello Helical Team,

I am using helical insight enterprise edition. I have created a report in which I am passing the value of filter into the dynamic view. But for all the other filter values it is working fine but for all value it is generating wrong SQL ?

Please help

image

Thank You,
Netta.

Hello Netta,

The value which you are selecting at the filter level is getting passed inside the dynamic view. Now you are selecting ‘_ all _’ at the report level and that is getting passed inside the dynamic view and that is a correct behavior.

Now in order that when ’ _ all _ ’ is passed you have to add an additional or condition in your dynamic view so that when this value comes it will bypass the filter. You can refer to the below code wherein we have added one more OR condition and checking that if the filter value is selected _ all _ then _ all _ becomes equal to _ all _ and thus that filter gets bypassed.

Sample code :

if (hasFilters())
{

filter_divisionid=findFilterByLabel("divisionid")

return "select divisionid,month,year from primary_sales_data where ('_all_' in ($filter_divisionid.value) or divisionid in ($filter_divisionid.value))"

} else{

return "select divisionid,month,year from primary_sales_data"

}

Thank You,
Helical Team.