Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

london1980
New Contributor

Button Object with calculation

Hi All,

I'm trying to create a button object but it's not working.

Action - Select in Field

Field

=Inventory/Weekly_Demand

Search String

<1

Basically I want divide my inventory quantity by weekly demand to see how many weeks of inventory I have and want the button to show the items where my inventory is less than 1 week.

any suggestion will be highly appreciated

thanks

MT

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Button Object with calculation

No, you can only use fields to make selections in. So you need to put a field name (without any leading equal sign, just the field name) under Field in the action dialog. I don't know the name of that field, but since you want to filter items, put the field name corresponding to items there.

Then use

='=Sum(Inventory) / [Weeekly Demand] <1'

as search string. This should work if sum(Inventory) as well as [Weekly Demand] return values per item.

In other words:

You need to be able to create a chart with dimension Item (or whatever your field is called) and an expression

=Sum(Inventory) / [Weeekly Demand]

and this expression should return number of weeks you can work with inventory at hand per Item value.

4 Replies
MVP
MVP

Re: Button Object with calculation

For the field, just use the fieldname, without the leading equal sign:

Inventory/Weekly_Demand

edit: I've missed that this is not a field name.

Try to make a selection in field Item (or whatever this field is named, you can only use field names for a select in field action)

and as expression something like

='=Sum(Inventory) / [Weeekly Demand] <1'

london1980
New Contributor

Re: Button Object with calculation

so in Button > Actions > Select in Field i put this formula    ='=Sum(Inventory) / [Weekly Demand] <1'    under Field and left Search String blank, didn't work. Is that what you meant?

MVP
MVP

Re: Button Object with calculation

No, you can only use fields to make selections in. So you need to put a field name (without any leading equal sign, just the field name) under Field in the action dialog. I don't know the name of that field, but since you want to filter items, put the field name corresponding to items there.

Then use

='=Sum(Inventory) / [Weeekly Demand] <1'

as search string. This should work if sum(Inventory) as well as [Weekly Demand] return values per item.

In other words:

You need to be able to create a chart with dimension Item (or whatever your field is called) and an expression

=Sum(Inventory) / [Weeekly Demand]

and this expression should return number of weeks you can work with inventory at hand per Item value.

london1980
New Contributor

Re: Button Object with calculation

Now I got it, many thanks!

Community Browser