Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
shahafei2
Contributor

triggers - select based on expression

Hi all,

 

There is a way to set a trigger (OnChange of a variable - vMaxSales) that will select the required dates based on expression?

 

I would like to select the dates where the

sum(sales)<=$(vMaxSales)

 

How could i set it?

4 Replies
MVP & Luminary
MVP & Luminary

Re: triggers - select based on expression

Add a Select in Field action to the OnChange variable trigger of your variable. Use your date field as the field in which to select the values. And use as search string ='=sum(sales)<=$(vMaxSales)'


talk is cheap, supply exceeds demand
shahafei2
Contributor

Re: triggers - select based on expression

Thank you

 

I tried to set it with an action "Select in field" but its not working for some reason

in the field i set "Date"

 

and in the search string i set

='=sum(Sales)<=$(vMax_Sales)'

shahafei2
Contributor

Re: triggers - select based on expression

I success to make it by 

generation of a new resident table in the script

 

Daily sales:

Date,

Sum(Sales) as Daily_Sales

resident data

group by Date;

 

and than i set the (OnChange) trigger ("Select in field" action)  to:

 

Field:

Daily_Sales

 

Search string:

='<=$(vMax_Sales)'

MVP & Luminary
MVP & Luminary

Re: triggers - select based on expression

Perhaps the OnInput variable trigger works.

talk is cheap, supply exceeds demand