Announcements
[WEBINAR] Accenture & Qlik: Accelerating BI Migration to SaaS with Qlik on Dec 13th: REGISTER
cancel
Showing results for
Did you mean: Not applicable

## Problem with conditional & alt result

Hi

I have this formula in one pivot table graph however the last result isn't giving me what I need.

alt(if((FABS(Sum ([UN DEVUELTAS]))/(Sum ([UN VENDIDAS])+Sum ([UN CANCELADAS])))>2,2,fabs(Sum ([UN DEVUELTAS]))/(Sum ([UN VENDIDAS])+Sum ([UN CANCELADAS]))),"X")

the basic formula is this: Sum ([UN DEVUELTAS])/(Sum ([UN VENDIDAS])+Sum ([UN CANCELADAS])

if this formula give me a result greater than 2, it should report 2

and if this formula is undetermined (9/0), it should report 1

if i use the formula  with 0 as "X", the original formula and the  first conditional works however the second conditional doesn't work and the others columns of the pivot table works also,

if i use the formula  with 1 as "X", nothing works (the original formula, the  first conditional & the second conditional & all the other columns of the pivot table, i don't know why the are affected by the result of this column)

what should I change???

the script of my table is like this:

VENTAS:

[FECHA DE FACTURA],

CODIGO,

[UN VENDIDAS],

[UN DEVUELTAS],

FROM

(ooxml, embedded labels, header is 5 lines, table is HBRIEF_7534);

regards,

1 Solution

Accepted Solutions  MVP & Luminary

Try this:

if(FABS(Sum ([UN DEVUELTAS]))/(Sum ([UN VENDIDAS])+Sum ([UN CANCELADAS]))>2,

2,

alt(fabs(Sum ([UN DEVUELTAS]))/(Sum([UN VENDIDAS])+Sum ([UN CANCELADAS])),1))

- Marcus

2 Replies  MVP & Luminary

Try this:

if(FABS(Sum ([UN DEVUELTAS]))/(Sum ([UN VENDIDAS])+Sum ([UN CANCELADAS]))>2,

2,

alt(fabs(Sum ([UN DEVUELTAS]))/(Sum([UN VENDIDAS])+Sum ([UN CANCELADAS])),1))

- Marcus Not applicable
Author

Thanks for your help,.,.,that worked perfectly

Regards,

Peter Community Browser