# Allmänna numeriska funktioner

I dessa allmänna numeriska funktioner är argumenten uttryck där x ska tolkas som ett reellt tal. Alla funktioner kan användas både i laddningsskript och diagramuttryck.

Använd listrutan för varje funktion för att visa en kort beskrivning och syntax för varje funktion. Klicka på funktionens namn i syntaxbeskrivningen för fler detaljer.

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### bitcount

BitCount() tar reda på hur många bitar i den binära motsvarigheten till ett tal som är inställda på 1. Denna funktion returnerar alltså antalet inställda bitar i integer\_number där integer\_number tolkas som ett signerat 32-bitars heltal.

[**bitcount**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/bitcount.htm)(integer\_number)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### div

Div() returnerar heltalsdelen av den aritmetiska divisionen av det första argumentet med det andra argumentet. Båda parametrarna tolkas som reella tal, de behöver alltså inte nödvändigtvis vara heltal.

[**div**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/div.htm)(integer\_number1, integer\_number2)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### fabs

Fabs() returnerar absolutvärdet för x. Resultatet blir ett positivt tal.

[**fabs**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/fabs.htm)(x)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### fact

Fact() returnerar faktorn av ett positivt heltal x.

[**fact**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/fact.htm)(x)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### frac

Frac() returnerar fraktioner till höger om decimalkommat för x, där x är ett reellt tal.

[**frac**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/frac.htm)(x)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### sign

Sign() returnerar 1, 0 eller -1 beroende på om x är ett positivt tal, 0 eller ett negativt tal.

[**sign**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/sign.htm)(x)

## Kombinations- och permutationsfunktioner

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### combin

Combin() returnerar antalet kombinationer av q-element som kan väljas från en uppsättning p-element. Motsvaras av formeln: `Combin(p,q) = p! / q!(p-q)!` Ordningen som komponenterna väljs i är inte signifikant.

[**combin**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/combin.htm)(p, q)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### permut

Permut() returnerar antalet permutationer av q element som kan väljas från en uppsättning med p element. Motsvaras av formeln: `Permut(p,q) = (p)! / (p - q)!` Ordningen som komponenterna väljs i är signifikant.

[**permut**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/permut.htm)(p, q)

## Modulofunktioner

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### fmod

fmod() är en modulofunktion som returnerar den återstående delen av divisionen av det första argumentet (dividenden) med det andra argumentet (divisorn). Resultatet blir ett reellt tal. Båda argumenten tolkas som reella tal, de behöver alltså inte nödvändigtvis vara heltal.

[**fmod**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/fmod.htm)(a, b)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### mod

Mod() är en modulofunktion som returnerar den icke-negativa återstoden av en heltalsdivison. Det första argumentet är dividenden, det andra argumentet är divisorn. Båda argumenten måste vara heltalsvärden.

[**mod**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/mod.htm)(integer\_number1, integer\_number2)

## Paritetsfunktioner

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### even

Even() returnerar True (-1) om integer\_number är ett jämnt heltal eller noll. Den returnerar False (0) om integer\_number är ett udda heltal och NULL om integer\_number inte är ett heltal.

[**even**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/even.htm)(integer\_number)

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### odd

Odd() returnerar True (-1) om integer\_number är ett udda heltal eller noll. Det returnerar False (0) om integer\_number är ett jämnt heltal och NULL om integer\_number inte är ett heltal.

[**odd**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/odd.htm)(integer\_number)

## Avrundningsfunktioner

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### ceil

Ceil() avrundar x uppåt till närmaste multipel av step [+ offset]. Standardvärdet för offset är 0.

[**ceil**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/ceil.htm)(x[, step[, offset]])

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### floor

Floor() avrundar x nedåt till närmaste multipel av step [+ offset]. Standardvärdet för offset är 0.

[**floor**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/floor.htm)(x[, step[, offset]])

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/general-numeric-functions-charts.htm)

#### round

Round() returnerar resultatet av avrundning av x uppåt eller nedåt till närmaste multipel av step [+ offset]. Standardvärdet för offset är 0.

[**round**](https://help.qlik.com/sv-SE/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/GeneralNumericFunctions/round.htm)( x [ , step [ , offset ]])