Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gasparbenito
Contributor II
Contributor II

KPI value from calculated field of straight table

Hi all, 

I have created the next fields (in red) at the next table:

Pedido IDAlmacen ExpediciónMaterialCajasCajas PCCajas PK
  TOTALS19.56115.8003.761
00000676191003ALLIOLI MORTERO 180MLX12UDS CHOVI48048
00000676131003ALLIOLI MORTERO 180MLX12UDS CHOVI60060
00000676111003ALLIOLI MORTERO 180MLX12UDS CHOVI60060
00000676101003ALLIOLI MORTERO 150MLX12UDS CHOVI2082080
00000676101003ALLIOLI CUBO 2LX4UDS CHOVI101
00000676091003ALLIOLI MORTERO 150MLX12UDS CHOVI707
00000676081003ALLIOLI MORTERO 150MLX12UDS CHOVI16016
00000676071003MAYO25 CUBO 10 L CHOVI48480
00000676071003MOSTAZA AMARILLA CHOVI 6G X 378 UDS48048
00000676071003HARINA REBOZAR 1 KG505
00000676071003T.HAMBURGUESAS 1216016
00000676071003KETCHUP 12G X 252 CAJA16016
00000676071003SALSA ALLIOLI 12G - 252 SOBRES/CAJA16016
00000676071003SALSA BARBACOA 950GR CHOVI404
00000676071003VINAGRE CAJA 250 SOBRES 10 ML CHOVI808
00000676071003ACEITE OLIVA SOBRE 10MLX250UDS CHOVI808
00000676071003SALSA CESAR 820 ML AMBIENTE.303
etc     

 

and this is how: 

CAJAS: sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])

CAJAS PC: round(Floor(sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])/sum(UMREZ))) * sum(UMREZ)

CAJAS PK: sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])- round(Floor(sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])/sum(UMREZ))) * sum(UMREZ)

The problem is when creating a KPIS of the totals, it does not work and gives values 0
How could it be solved?

 

Thanks for your help!

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Try this

CAJAS:
Sum({<DataType = {'ENTREGAS'}, [En Preparacion] = {'SI'}>}[Cantidad Entregada])

CAJAS PC: 
Sum(Aggr(
Round(Floor(Sum({<DataType = {'ENTREGAS'},[En Preparacion] = {'SI'}>}[Cantidad Entregada])/Sum(UMREZ))) * Sum(UMREZ)
, [Pedido ID], [Almacen Expedición], [Material]))

CAJAS PK:
Sum(Aggr(
Sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])- round(Floor(sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])/sum(UMREZ))) * sum(UMREZ)
, [Pedido ID], [Almacen Expedición], [Material]))

View solution in original post

2 Replies
sunny_talwar

Try this

CAJAS:
Sum({<DataType = {'ENTREGAS'}, [En Preparacion] = {'SI'}>}[Cantidad Entregada])

CAJAS PC: 
Sum(Aggr(
Round(Floor(Sum({<DataType = {'ENTREGAS'},[En Preparacion] = {'SI'}>}[Cantidad Entregada])/Sum(UMREZ))) * Sum(UMREZ)
, [Pedido ID], [Almacen Expedición], [Material]))

CAJAS PK:
Sum(Aggr(
Sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])- round(Floor(sum({<DataType={'ENTREGAS'},[En Preparacion]={'SI'}>}[Cantidad Entregada])/sum(UMREZ))) * sum(UMREZ)
, [Pedido ID], [Almacen Expedición], [Material]))

View solution in original post

gasparbenito
Contributor II
Contributor II
Author

Perfect Sunny_talwar.

You are great!

Thank you very much!