Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello experts
I have a problem to find the closeset number with qliksense .
Explination :
I have a value x = 3 and i have a colunm A that contains (1,2,4,5,9).
I want a function that returns 2 as the closeset value to my x
if x for example change to 6 my closeset number will be 5
if x =2 then 2.....
Thank you in advance.
When x=3, then you want 2 and not 4 (both being closest). Is it always such that in case of tie - you want lower value?
Assuming your x a variable, you could try like:
=FirstSortedValue(DISTINCT [Col A], fAbs([Col A]-VariableX))
When x=3, then you want 2 and not 4 (both being closest). Is it always such that in case of tie - you want lower value?
Assuming your x a variable, you could try like:
=FirstSortedValue(DISTINCT [Col A], fAbs([Col A]-VariableX))
i want to be always the lower value. its not the case with this formula
Try:
=FirstSortedValue( [Col A], if([Col A]<=VariableX,VariableX-[Col A]))
doesnt work