Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts.
I am trying to calculate the difference between two dates (a date and a dateTimeStamp).
-When I sum the dimension, it is not doing as I am specting: Days = Sum(DIAS_INSTALACION)
The script editor:
Ventas: First 52000 LOAD PEDIDO_ID, Date(Floor(TimeStamp(FECHA_INSTALACION,'DD/MM/YYYY hh:mm:ss')), 'DD/MM/YYYY') as FECHA_INSTALACION, FECHA_CITA FROM [lib://Datos/VENTAS_TBL.qvd] (qvd); left join LOAD PEDIDO_ID, Num(FECHA_CITA-FECHA_INSTALACION) as DIAS_INSTALACION Resident Ventas;
Am I missing something?
What happens if you use measure SUM(DIAS_INSTALACION) instead of the dimension DIAS_INSTALACIONin your chart?
I notice you are joining the data back into your Ventas table, if you hav duplicate PEDIDO_ID then your join will create duplicate rows. You could try this approach instead.
Ventas: LOAD
PEDIDO_ID,
FECHA_CITA,
FECHA_INSTALACION,
Num(FECHA_CITA-FECHA_INSTALACION) as DIAS_INSTALACION
; LOAD PEDIDO_ID,
FECHA_CITA, dayname(TimeStamp(FECHA_INSTALACION,'DD/MM/YYYY hh:mm:ss')) as FECHA_INSTALACION FROM
[lib://Datos/VENTAS_TBL.qvd] (qvd)
;
Hi,
Will you be able to share masked data and or sample QVF file?
What happens if you use measure SUM(DIAS_INSTALACION) instead of the dimension DIAS_INSTALACIONin your chart?
I notice you are joining the data back into your Ventas table, if you hav duplicate PEDIDO_ID then your join will create duplicate rows. You could try this approach instead.
Ventas: LOAD
PEDIDO_ID,
FECHA_CITA,
FECHA_INSTALACION,
Num(FECHA_CITA-FECHA_INSTALACION) as DIAS_INSTALACION
; LOAD PEDIDO_ID,
FECHA_CITA, dayname(TimeStamp(FECHA_INSTALACION,'DD/MM/YYYY hh:mm:ss')) as FECHA_INSTALACION FROM
[lib://Datos/VENTAS_TBL.qvd] (qvd)
;
I'm attaching an example.
As you see in the screenshot below, you have duplicate PEDITO_ID, which leads to the sum(DIAS_INSTALATCION) will be wrong, when joining a table without a unique primary key you could get duplicate rows. I think you should consider my preceding load solution in my earlier answer.