Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If the script

Dear,

I need help.

Need to create a Dimension Calculated or in my script the calculation below, however I'm not getting.

In copy excel to illustrate what I'm talking about.

8 Replies
giakoum
Partner - Master II
Partner - Master II

something like that ?

Filial STATUS Sum([Itens Total]) sum([Itens Estoque]) sum([itens Liberados])
59.033 7.404 51.629
CRAVINHOSBLOQUEIO PARCIAL37.2792.3934.889
CRAVINHOSBLOQUEIO TOTAL14.7542.91411.84
CRAVINHOSSEM BLOQUEIO72.14.9
robert_mika
Master III
Master III

Try this:

Not applicable
Author

Hi,

I see you have to move Status to rows, because now you have it in columns. Just "drag and drop" label "status" and try to move it to rows.

Second thing - in Excel you have 2 expressions, and in QV you must have also 2 expressions (in table properties, on Expression tab, click "Add" button and write second expression):

Sum([itens Liberados])

Sum([Itens Estoque])

See the attached file.

Not applicable
Author

Hello.

I believe I was not clear.

The problem is in the calculation of status, the correct values are in excel.

example:

Imagem1.jpg

giakoum
Partner - Master II
Partner - Master II

these two are exactly the same :

IF ( ([Itens Total] - [itens Liberados]) = [Itens Estoque], 'BLOQUEIO PARCIAL',

     IF ( ([Itens Total] - [Itens Estoque]) = [itens Liberados], 'SEM BLOQUEIO',

so for the same if, you try to apply 2 different values. It will always be the first I guess

robert_mika
Master III
Master III

Fallowing your logic from Excel file Try this in your script

IF ([Itens Total] = [Itens Estoque], 'BLOQUEIO TOTAL',

     IF ( [Itens Total] - [itens Liberados]=[Itens Estoque] AND  IsNull([Itens Estoque]), 'BLOQUEIO PARCAIL',

     IF([Itens Total]-[itens Liberados] =[Itens Estoque], 'BLOQUEIO TOTAL'))) AS STATUS

Not applicable
Author

I tried this, but it did not work.

I'm having trouble finding the right logic to solve the problem.

robert_mika
Master III
Master III

In your Excel file Column J2

=H2+I2

drag down

In your .qwv file change the IF statement to

IF ( [Itens Total] = [Itens Estoque], 'BLOQUEIO TOTAL',

    IF ( [Itens Total] = [itens Liberados],'SEM BLOQUEIO',  'BLOQUEIO PARCAIL'

    )) AS STATUS

For some reason when the Total was enter as number not as formula QLikview wrongly calculated the totals.