Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jose_vargas
Creator
Creator

2 dimension in Line Chart - Date and Hour

HI Community.

I have a problem, i hope u can help me.

I have this fields.

  • Date
  • Hour
  • Quantity
  • Station

When i use dimension Date or Hour with "Station" and sum qunatity, the chart its OK

q1.png

q2.png

What I need is to group the hours for each day in the same Line Chart.  I would like to do something like that...

q3.jpg

ACtually, if i select a month, I see just the 23 hours for all the month and i wanna see por each day.

Thanks.

José V.

8 Replies
Digvijay_Singh

What do you see if you take first dimension as Date and the next dimension as hour?

vinieme12
Champion III
Champion III

You need to create a new field and use a single dimension for this chart

Create a new field as and use this in the chart

TimeStamp(DateField &' '& Timefield, 'whatever the format') as DateTimeStamp,

https://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Scripting/InterpretationFunct...

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

you can also refer this post to create the timestamp

https://community.qlikview.com/thread/69389

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
jose_vargas
Creator
Creator
Author

If I do that....  i cant see the "station"

q4.jpg

I wanna see each date with the group of hour...........

jose_vargas
Creator
Creator
Author

Hi Vineeth.

I try with timestamp, but the field Date, show me like a number. the hour is ok but date its a problem

I used that

=TimeStamp#(Fecha &'-'& Formato_TamanoFila,'DD.MM.YYYY hh:mm')

WHere should i put this code? in a dimension rigth?

jose_vargas
Creator
Creator
Author

I try with this code in dimension:

=Timestamp(Date#(Fecha,'DD-MM-YYYY') & ' ' & Time#(Formato_TamanoFila,'hh:mm:ss'), 'DD-MM-YYYY hh:mm:ss')

q5.png

Now i can see the date and hour together... but, the sum of quantity dont work for this field (time-hour).

Anyonw know how to solve that??'

Thank.

jose_vargas
Creator
Creator
Author

I cant find the solution. I try to explain better.

I  have 2 table that i load like a dimension through script.

Dim_Hora --> come from my table Hour

LOAD

    Hora_Key,

    Formato,

    Hora,

    Minuto,

    Segundo

FROM $(cRutaDatosQVD_Dimensiones)RE_Dim_Hora.qvd(qvd);

Dim_Date --> come from my table Date

LOAD

    Tiempo_key,

    date(Fecha,'DD/MM/YYYY') as Fecha,

    NumDiaSemana,

    left(NombreDiaSemana,3) as [Día Semana],

    NumDiaMes as [Día]

FROM $(cRutaDatosQVD_Dimensiones)RE_Dim_Tiempo.qvd(qvd);

My Fact  QueueSize  come from my table QueueSize

LOAD

    'AV_Fact_Tamano_Fila_A' as [Tipo_Fact_Key],

    Tiempo_key,

    Estacion_Key as Station,

    Hora_Key,

    Cantidad as Quantity

FROM $(cRutaDatosQVD_Hechos)AV_Fact_Tamano_Fila_A.qvd(qvd);

So, I need to agrupate in a Line Chart  2 fields in on dimension. the field Fecha (from Dim_Date) and the field Formato (from Dim_Hour)

q3.jpg

shiveshsingh
Master
Master

Create a new field based on your requirement and use it in dimension