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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using field names from variables.

I have 2 formulas:

vNumeratorField = '[' & Only({1} NumeratorNames) & ']'

vDenominatorFiels= '[' & Only({1} DenominatorNames) & ']'

I need them, to find out which fields, I have to use in order to calculate the defined ratio. The typical output is following:

KPI_NameNumerator Field NameDenominator Field NameMinHeader 5
Ratio1=$(vNumeratorField)=$(vDenominatorField)

I am trying to find out the minimum and the maximum values doing the following for minimum:

=Min($(=$(vNumeratorField))/$(=$(vDenominatorField)))

And the same logic for maximum, but I always get '-'.

I tried to do the minimum without variables and it works perfectly: Min([FIELD1]/[FIELD2]).

Can someone advice, what should be done in other way? The issue is that I need to always ignore selections on NumeratorNames and DenominatorNames fields. That's why I am using variables and Only()

6 Replies
YoussefBelloum
Champion
Champion

Hi,

try this:

Min( {<NumeratorNames,DenominatorNames>} [FIELD1]/[FIELD2])

ogautier62
Specialist II
Specialist II

Hi,

you surely have a nested agregation (because of only)

try with :

min (aggr($(vNumeratorField)/$(vDenominatorField), your dimension))


regards

Anonymous
Not applicable
Author

Thanks for the suggestion, but it doesn't do the trick (

ogautier62
Specialist II
Specialist II

that gives what ?

null ?

to select all

min({1}aggr( .......)

Anonymous
Not applicable
Author

The output is always '-' and same applies to min({1} aggr(....)). When I try to use:

=Aggr($(vNumeratorField)/$(vDenominatorField),KPI_Name),

then I see the names for the right fields, but the division '/' sign gets dissapeared and the selection is, obviously, not ignored.

ogautier62
Specialist II
Specialist II

aggr does not pally to kpi_name but :

min (aggr(only({1} NumeratorField,NumeratorField)) / ......

it becomes complicated,

why not :

min({1} NumeratorField/NumeratorField))

without using only ?