Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression using a selection and other value

Hello People!

Here is my new problem of the day.

I have an expression that looks somwhow like this:

=sum(value) / sum({<client={"Total"}>} value)

What's happening? My selected value is any client, but when in the Divisor i make like my selection is "Total" it makes the selection for the whole expression ="Total". So in the chart, there never appears the original selected value.

any ideas?

21 Replies
Not applicable
Author

Ignacio

si lo haces por partes...

en un textbox haces la suma de Client='Total' y luego vas expandiendo la expresión.,..

es decir =sum ({<client='Total'>} value)

sin realizar ninguna selección previamente.

Not applicable
Author

No te comprendo muy bien, poner en un textbox la suma para ver que retorna? y desde la expresión de la tabla llamar al textbox?

Not applicable
Author

Es una forma de realizar QA a la expresión... cuando estamos un poco perdidos... se utiliza el textbox... en una pestaña aparte  y se va validando por pedazos la expresión.

saludos

Not applicable
Author

Me muestra perfectamente el valor del total en cualquiera de las distintas selecciones, entonces el problema debe estar en la selección del cliente.

Buen tip el del textbox

Not applicable
Author

la selección del cliente te refieres a client='Total'? o que especificamente y cuales expresiones has validado en el textbox.

viste en la pagina que te puse..el tema del marcador...?

tal vez funcione en este caso.

saludos

Not applicable
Author

No, la selección es el que tengo marcado.....yo desearía que la sum de client="total" fuese casi que fija...

puse ambas expresiones. en la de client=total me sale el valor perfectamente.

y en la otra donde no esta aclarado el filtro del cliente me muestra la suma de el cliente o clientes seleccionados.

Veré lo del marcador.

Not applicable
Author

JuanD Jaramillo te comento que usé un text box para usar toda la fórmula y si funciona, me da el valor que ando buscando....cual puede ser el problema entonces???

Not applicable
Author

Que Bien! Ignacio..

Pues.. yo haria lo siguiente:

1. en una pestaña nueva crearia una nueva pivot table.

y cual expresión te funcionó?

saludos,

p.d que dimensiones estas utilizando?

Not applicable
Author

Ando probando cosas, ahora estoy si me salen todos los clientes, pero ninguno me muestra su Market Share.

Me muestra un total de la suma de todos los productos entre el total, me muestra un único porcentaje arriba de las selecciones.

Not applicable
Author

In English for everybody,

i had advanced a little, i am using a straight table where I want to display the Market Share percentages of each client from the total market.

I have this expression:

=sum({<Date ={">=$(=DateStart) <=$(=DateEnd)"},Month=,Year=>} Value)

/

sum({<client={'TOTAL'},Date ={">=$(=DateStart)<=$(=DateEnd)"},Month=,Year=>} Value)

i have a list box where i select 1 or more clients, and i have included in that list box the client 'TOTAL' where is the total amount of the clients.  therefore the equation will be something like harold's sales / total sales = Market Share of Harold.

I have tried many things, I even make text objects for each part of the equation.

This part in the text object:

sum({<client={'TOTAL'},Date ={">=$(=DateStart)<=$(=DateEnd)"},Month=,Year=>} Value)

Gave me what i wanted i amount of the total sales, if i made any selections of any clients it gave me the amount i wanted.

But this part:

sum({<Date ={">=$(=DateStart) <=$(=DateEnd)"},Month=,Year=>} Value)

will give me the sum of the selected cllients, that is good in the text box.

The problem is that in the straight chart, at this moment shows: if one client is selected, at the end of the row where the Market Share should be is an ' - ' and at the superior row there's the value.

(Because i checked show expression total).

When i select more than one client, so i can see which client has bigger market share, is the same in every row at the last colum where the Market Share should be there's an ' - ', and at the top row of every selection is the Market Share of all the products selected over the TOTAL (Because i checked show expression total).

Please help, i am struggling here.