Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day!
I have a problem when trying to create an expression of me as a result the total number of kilometers traveled for a day. Citing the following table unit 1 begins his workday with 237 kilometers of bygone days hence to calculate the mileage of the day only 08/02/2015 must subtract 908-237. I wonder how I can perform this subtraction in an expression so that after being captured in a PivotTable.
Unidad | Fecha/Hora | Km recorridos |
---|---|---|
1 | 2/8/2015 10:10 am | 237 |
1 | 2/8/2015 8:15 pm | 543 |
1 | 2/8/2015 3:12 pm | 678 |
1 | 2/8/2015 9:00 pm | 908 |
Greetings!
Translated with Google Translate - Qlik Community Administrative Team
Buen día!
Tengo un problema al momento de tratar de crear una expresión que me de como resultado el número total de kilómetros recorridos durante un día. Poniendo como ejemplo la siguiente tabla la unidad 1 comienza su día laboral con 237 kilómetros recorridos de días pasados por lo tanto para poder calcular los kilómetros recorridos únicamente del día 2/8/2015 debo restar 908-237. Quisiera saber como puedo llevar a cabo esta resta en una expresión para que después sea plasmada en una tabla dinámica.
Saludos!
if you add a field Fecha
LOAD Unidad,
[Fecha/Hora],
[Km recorridos],
subfield([Fecha/Hora], ' ', 1) as Fecha
FROM
[https://community.qlik.com/thread/175095]
(html, codepage is 1252, embedded labels, table is @1);
you can make a chart like this
the expression is
max([Km recorridos]) - min([Km recorridos])
you can get the same result (without modify the script) in a chart with dimensions
subfield([Fecha/Hora], ' ', 1)
Unidad
expression
max([Km recorridos]) - min([Km recorridos])
if you add a field Fecha
LOAD Unidad,
[Fecha/Hora],
[Km recorridos],
subfield([Fecha/Hora], ' ', 1) as Fecha
FROM
[https://community.qlik.com/thread/175095]
(html, codepage is 1252, embedded labels, table is @1);
you can make a chart like this
the expression is
max([Km recorridos]) - min([Km recorridos])
you can get the same result (without modify the script) in a chart with dimensions
subfield([Fecha/Hora], ' ', 1)
Unidad
expression
max([Km recorridos]) - min([Km recorridos])
Thanks a lot Massimo! I will try it!
Hi again Massimo!
I have been trying to implement the expression and it works but only for the units that have more than one record. When a unit has only one record then Km Recorridos appear as "-". Do you know what can I do to make the kilometers appear.
try to uncheck suppress zero values as in image
see attachment
but when you only have 1 record there is no difference (distance)
Thanks! ¿Is there a way to suppress null values?