# Logiska funktioner

Den här delen beskriver funktioner som hanterar logiska operationer. Alla funktioner kan användas både i dataladdningsskriptet och diagramuttryck.

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/LogicalFunctions/logical-functions.htm)

#### IsNum

Returnerar -1 (True) om uttrycket kan tolkas som ett tal, annars 0 (False).

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/LogicalFunctions/logical-functions.htm)[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/LogicalFunctions/logical-functions.htm)IsNum( expr )

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/LogicalFunctions/logical-functions.htm)

#### IsText

Returnerar -1 (True) om uttrycket består av text, annars 0 (False).

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/LogicalFunctions/logical-functions.htm)[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/LogicalFunctions/logical-functions.htm)IsText( expr )

Anteckning om informationBåde IsNum och IsText returnerar 0 om uttrycket är NULL.

Exempel:

I det följande exemplet laddas en inline-tabell med blandade textvärden och numeriska värden, och två fält läggs till för att kontrollera om värdet är ett numeriskt värde eller ett textvärde.

```
Load *, IsNum(Value), IsText(Value)
Inline [
Value
23
Green
Blue
12
33Red];
```

Den resulterande tabellen ser ut så här:

Resulting table

| Value | IsNum(Value) | IsText(Value) |
| --- | --- | --- |
| 23 | -1 | 0 |
| Green | 0 | -1 |
| Blue | 0 | -1 |
| 12 | -1 | 0 |
| 33Red | 0 | -1 |