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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Dimension Mapping

Hello

My problem is that I need to create a calculated dimension that depending on the value of an expression (one Sum ) to calculate corresponding section the result of that expression.

Explained in more detail , I have many outlets , and within each of them ( and depending on the current selection ) I have to do that units sent to you and depending on your service has to go to a section or other service . A point of sale is a section of Service .

I can not calculate the Script -level sections , because it depends on the selection.

A sample output would look something like the image attached.

This result was achieved with the following expression , but the problem is that it is not optimal because the existing information takes a long time to load (2-3 minutes on the Windows client , Web- not even opened) .

Aggr ( If ($ ( vAuxTramoServicio ) = 1, 1, If ($ ( vAuxTramoServicio ) = 2 , 2 If ($ ( vAuxTramoServicio ) = 3,3 , if ( $ ( vAuxTramoServicio ) = 4,4 , if ( $ ( vAuxTramoServicio ) = 5,5 , if ( $ ( vAuxTramoServicio ) > = 6 And $ ( vAuxTramoServicio ) < = 10 , '6 to 10 ' , if ( $ ( vAuxTramoServicio ) > = 11 And $ ( vAuxTramoServicio ) < = 25 , ' 11-25 ' , if ( $ ( vAuxTramoServicio ) > = 26 And $ ( vAuxTramoServicio ) < = 50 , '26 to 50' , if ( $ ( vAuxTramoServicio ) > = 51 And $ ( vAuxTramoServicio ) < = 100 , '51 to 100 ' If ($ ( vAuxTramoServicio ) > = 101, ' Over 100 ' )))))))))) , CLAVE_PUNTO_VENTA , COD_NUMERO )

vAuxTramoServicio is

Sum ( { < [ ESTADO_PUNTO_VENTA ] = {' end '} >} NUM_ENTREGADOS + NUM_COMPLEMENTOS )

I tried an alternative , but I can not work any .

ApplyMap First I tried , but I 've noticed that this function only works in Script , because the Load Mapping are deleted when the script ends .

I uploaded some Excel with mapping of each of the possible outcomes that correspond stretch , but I have not got the expression that works.

I tried with FieldValue and FieldIndex , but the problem is that FieldValue are different values ​​, so I can not get the correct index to get the value it deserves. I mean for example if the service is 8, not service takes the stage 8 , but the 8th value TramoServicio .

Aggr ( FieldValue ( TramoServicio , FieldIndex ( EjemplaresServicio , $ ( vAuxTramoServicio ) ) ) , CLAVE_PUNTO_VENTA , COD_NUMERO )

I also tested with a function like this , but it does not work :

Aggr ( Only ( If ( EjemplaresServicio = $ ( vAuxTramoServicio ) TramoServicio ) ) , CLAVE_PUNTO_VENTA , COD_NUMERO )

The tests I've done with If I get nulls.

Please see if someone can help me or give me an idea with which to continue to work to optimize the expression of the calculated dimension .

Also attached an Excel with examples of mappings that I have to do.

0 Replies