Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!

Missing Manual - GetFieldSelections() + Bonus Example

cancel
Showing results for 
Search instead for 
Did you mean: 
robert_mika
Master III
Master III

Missing Manual - GetFieldSelections() + Bonus Example

Last Update:

Mar 2, 2015 9:55:50 AM

Updated By:

robert_mika

Created date:

Mar 2, 2015 9:55:50 AM

Attachments

Have you ever wondered how the examples from the Qlikview help may look like?

Please see below and enjoy responsibly...

GetFieldSelections()

Definition:

Returns a string with the current selections in a field.

valueSep - is the separator to be put between field values. The default is ', '.

max_values  - is the maximum number of field values to be individually listed.

                      When a larger number of values is selected the format 'x of y values' will be used instead.

                      The default is 6.

Preparation:


Script to play with:

Load * Inline

[

Year

2007

2008

2009

2010

2011

2012

2012

2013

2014

2015

2016

]

Example 1:

GetFieldSelections(Year )


Our field Year has 10 values (Years from 2007 to 2016)

The default separator is ',' (coma)

The maximum default numbers of values is 6

We used the same expression for all 3 sets of data

Left: Selection of 6 values

Middle: When more that 6 values the result will change to show the values which are not selected.

Right: Selecting whole sets of values will return 'ALL' as result

DataExpression and Results

Example 2: valueSep


We can assign here any character (or string).



Examples 3: max_values

The default values of 6 is overwritten by the value we have specified(10)

Interesting:

When playing with this function somehow I managed to get result like below

If you can replicate it please post it.

Bonus:

Practical use:

PROBLEM OF DIFFERENCE OF SUM

Still feeling hungry?

How to use - Only()

Do you Qualify?- How to use QUALIFY statement

How to use - Dimensionality()

Missing Manual - GetFieldSelections() + Bonus Example

MaxString & MinString - How to + examples

The second dimension... or how to use secondarydimensionality()

How to use - MissingCount()

How to use- Dual()

Expression Scene Investigation, E1: Moving Average

Comments
Not applicable

Hello David,

If you want to show all selected values, then you can create a variable & pass it at 'max_values' parameter.

Like e.g. in this case, LET vYearCount = Count(Year),

then in expression, =GetFieldSelections(Year,'~',vYearCount) will do the purpose.

Regards

Kiran Shinde

Not applicable

Thanks for the fast respons Kiran,

To avoid an unreadable title, I would like to have a max_value that is below the total amount of possible values. The output "x OF y" is very welcome, I just would like to keep that output instead of it switching to the "NOT"-notation.

Anonymous
Not applicable

Thank you Robert Mika, Nice examples.

ecolomer
Master II
Master II

Good post

Thank's for sharing

Saludos,

Enrique

Version history
Last update:
‎2015-03-02 09:55 AM
Updated by: