Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
alexvalqlik
Contributor III
Contributor III

Expression pivot table

Good afternoon, colleagues

I need your advice,

I have problems with an expression with double validation that does not show the expected result, I detail it at the end:

This expression works well, shows sales below 90% compared to the previous year

=Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } >}Venta_Neta/1000 )

is displayed correctly in the pivot table:

Captura de pantalla 2018-01-04 12.16.00.png

This expression also works well, showing sales per store greater than 100% compared to the previous year.

=Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta/1000 )

is displayed correctly in the pivot table:

Captura de pantalla 2018-01-04 12.21.59.png


This is the expression with which I have problems and I need help:

=( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

)

This Expression in addition to the warehouses that are between 91% and 99% with respect to the sales of the previous year, brings me warehouses with zero and negative values and I do not know how to eliminate them.

Captura de pantalla 2018-01-04 14.10.10.png

1 Solution

Accepted Solutions
OmarBenSalem
Partner - Champion II
Partner - Champion II

try :

if(

( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

) > 1 ,

( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

), 0 )

and keep the uncheck the zero

View solution in original post

7 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

can u try to uncheck show zero under adds-on?

Capture.PNG

alexvalqlik
Contributor III
Contributor III
Author

Thanks Omar, I already did it but it does not work.

alexvalqlik
Contributor III
Contributor III
Author

Thanks Omar, I already did it but it does not work.

Captura de pantalla 2018-01-04 15.55.03.png

OmarBenSalem
Partner - Champion II
Partner - Champion II

try :

if(

( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

) > 1 ,

( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

), 0 )

and keep the uncheck the zero

OmarBenSalem
Partner - Champion II
Partner - Champion II

or

if(

aggr(( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

) ,Almacen) > 1 ,

( Sum({<Año={$(v_AñoAct)}>}Venta_Neta) -

   Sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) < (sum({<Año={$(v_AñoAnt)}>} Venta_Neta)*.90)' } > } Venta_Neta ) -

   sum( { < Nomb_Almacen = { '=Sum({<Año={$(v_AñoAct)}>} Venta_Neta) >= sum({<Año={$(v_AñoAnt)}>} Venta_Neta)' } > } Venta_Neta )

), 0 )

alexvalqlik
Contributor III
Contributor III
Author

Thanks Omar, I believe your solution if it works, I will review the values.

Thank you so much.

Captura de pantalla 2018-01-04 16.59.41.png

OmarBenSalem
Partner - Champion II
Partner - Champion II

Glad to know

Please, don't forget to close the thread if ur question has been answered by marking the right answer as correct.