Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Mattia
Contributor II

How can i correct this expression in the script?

Hi QV users,

i've a problem with the following expressions in the script:

KEY_TO_VALORE_PRESTAZIONE:
Mapping LOAD
[@10:17] as CONTATORE_PRESCRIZIONE,
[@37:45] as VALORE_PRESTAZIONE

Num(If([@306:306]=0, if(ApplyMap('KEY_TO_VALORE_PRESTAZIONE',[@37:45],'n/a')>0,Num(Left([@37:45],7)&','&Num(Right([@37:45],2),0))))) as VALORE

The output i want to obtain is a new field called "VALORE" that if the field [@306:306] contains the value "0", return the first 7 numbers of the field [@37:45], a comma, and the last 2 numbers of the same field.

Please, can someone show me the right direction?

Thanks,

Mattia

Labels (5)
2 Replies
Highlighted
jobsonkjoseph
Contributor III

Re: How can i correct this expression in the script?

Hi,

instead of applymap;

Can you try if the below code works out, i'm not so sure, but can try;

CASE WHEN([@306:306]=0) then left([@37:45],7) &','&right([@37:45],2) else 0 as VALORE

Highlighted
Mattia
Contributor II

Re: How can i correct this expression in the script?

Hi Jobsonkjoseph,

sorry, but in QV i don't find the CASE WHEN statement.

Can you give me any other suggest?

Thanks,

Mattia