Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem using the same field in set analysis and conditional?

Hi

I have this calculated value:

(SUM({<AGRUPA_CONCEPTO={BONIFICACIONES_TOTAL}>}VALOR)/1000)/(SUM({<CONCEPTO = {GROSS_SALES} >}VALOR) / 1000)

And it's working

But when i try to do this it doesn't work. I don't know why. It doesn't show the field.

if (AGRUPA_CONCEPTO= 'POR_BONIF',

(SUM({<AGRUPA_CONCEPTO={BONIFICACIONES_TOTAL}>}VALOR)/1000)/(SUM({<CONCEPTO = {GROSS_SALES} >}VALOR) / 1000),

SUM(VALOR) / 1000)

This is because i'm using the same field in the set analysis and in the if conditional? I used this with an 1 and it works. Do you know why this isn't working?

Thank you

Greetings

9 Replies
sunny_talwar

Try this:

If(CONCEPTO = 'POR_BONIF',

(SUM({<AGRUPA_CONCEPTO={BONIFICACIONES_TOTAL}>}VALOR)/1000)/(SUM(TOTAL {<CONCEPTO = {GROSS_SALES} >}VALOR) / 1000),

SUM(VALOR) / 1000)

Not applicable
Author

Thank you! but it didn't work. It's the same with or without total

Greetings

sunny_talwar

What are you seeing 0 or - when you use your expression?? Can you try them as two separate expressions and see which one isn't working??

If(CONCEPTO = 'POR_BONIF', (Sum({<AGRUPA_CONCEPTO={BONIFICACIONES_TOTAL}>}VALOR)/1000))


If(CONCEPTO = 'POR_BONIF', (Sum(TOTAL{<CONCEPTO = {GROSS_SALES} >}VALOR) / 1000))

See which one isn't working

Not applicable
Author

I don't see 0 or -.

directly i don't see the dimmension 'POR_BONIF'



I see only the else, the 'VALOR)/1000)'

sunny_talwar

You don' see the the dimension 'POR_BONIF'?? Why not?? I don't really undertand the issue here, can you share a screenshot of what you are seeing???

antoniotiman
Master III
Master III

If BONIFICACIONES_TOTAL and GROSS_SALES are Fields try to use P() in Set Analysis

AGRUPTA_CONCEPTO=P(BONIFICACIONES_TOTAL)  

CONCEPTO=P(GROSS_SALES) 

Not applicable
Author

The field POR_BONIF. yeah, i don't see it.

Because the first part of the expression isn't working

sunny_talwar

So this expression isn't working?

If(CONCEPTO = 'POR_BONIF', (Sum({<AGRUPA_CONCEPTO={BONIFICACIONES_TOTAL}>}VALOR)/1000))

maximiliano_vel
Partner - Creator III
Partner - Creator III

Can you send us a sample of your data??