Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nakul1001
Creator II
Creator II

Variable storing a value based on island table

Hello QlikView Gurus,

I am troubleshooting an existing application and have come across this scenario:-

The datamodel along with facts and dimension tables contains an Island table that has a single column: _Name.

This column has values: Sales,Flow,Asset

A list box is used in the dashboard to show the above values from this field (_Name)

There is a line chart that has two dimensions: Month and ='$(vCycDim)'.

Now based on the selection in the list box (or even a multibox having _Name field), the value for variable vCycDim gets updated.

E.g if list box has 'Sales' selected, the variable vCycDim gets the value 'Sales'. In the Variable Overview window I only see the string 'Sales' as the value for this variable. There is no expression.

I am aware of GetFieldSelections function but I am not able to find out how the variable value is assigned with a selection in listbox or multibox? There is no macro or Action(as in text box or button object) that is assigning the value. Not sure how the variable is picking the value?

I am sure this is a very common approach and hope my explanation is clear.

Any ideas?

Thanks

Nakul

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Check the field triggers on the Triggers tab of the Document Properties window. It sounds like your variable is set by an action assigned to the OnSelect of one of the fields.


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
sunny_talwar

If your variable is defined with GetFieldSelections, then the function itself is telling the variable to use whatever is selected as a vCycDim. My guess is that the list box it is linked to has Always One Selected Value option selected to make sure that user are unable to select more than one value at a time.

awhitfield
Partner
Partner

Hi,

What's the definitions of the variable vCycDim?

Andy

Gysbert_Wassenaar

Check the field triggers on the Triggers tab of the Document Properties window. It sounds like your variable is set by an action assigned to the OnSelect of one of the fields.


talk is cheap, supply exceeds demand

View solution in original post

nakul1001
Creator II
Creator II
Author

That's right, the list box has Always One Selected Value. In the variable overview window, since this variable always has a string value, I am not sure what function was originally defined. If I were to create a new variable, vCycDim1 (that stores the same set of values), what should the approach be?

sunny_talwar

You can use do it bunch of ways:

vCycDim1 = GetFieldSelections(ListBoxField) or

vCycDim1 = Concat(DISTINCT ListBoxField) or

vCycDim1 = Only(ListBoxField)


I think all of the above should work.

Best,

Sunny

nakul1001
Creator II
Creator II
Author

It just shows up with a string value (eg: Sales)

nakul1001
Creator II
Creator II
Author

Yes! I found a FieldEvent Trigger for this field that 'OnSelect' assigns the value to the variable. I did check the triggers tab before but must have missed it! Thanks Gysbert.