Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to establish rules generally?

Hi Everybody.

I have a table call [Crudo de Incidentes] that is compose for a lot equal tables inside, i need to use something like:

Year ([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Año,

Month([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Mes,

Day ([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Dia,

Hour ([Inicio de Afectacion|Inicio de la interrupcion de servicio])as Hora,

But i don´t want to use this in every table that i add to [Crudo de Incidentes], for this reason, How do i declare rule generally that involve all the tables in [Crudo de Incidentes] at the same time?.

Best Regards

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

So you're concatenating a bunch of tables with the same fields, and don't want to calculate Año, Mes, Dia and Hora over and over?

This is usually handled with a Calendar table.  In this case, though, you'd still need to at least establish the Hora on the main table since you're dealing with timestamps instead of dates.

In your case, I might instead wait until [Crudo de Incidentes] has been fully loaded, and then left join the dates on at the end:

LEFT JOIN ([Crudo de Incidentes])
LOAD the key field or fields to the table,
Year ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Año,
Month([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Mes,
Day  ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Dia,
Hour ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Hora
RESIDENT [Crudo de Incidentes]
;

View solution in original post

2 Replies
johnw
Champion III
Champion III

So you're concatenating a bunch of tables with the same fields, and don't want to calculate Año, Mes, Dia and Hora over and over?

This is usually handled with a Calendar table.  In this case, though, you'd still need to at least establish the Hora on the main table since you're dealing with timestamps instead of dates.

In your case, I might instead wait until [Crudo de Incidentes] has been fully loaded, and then left join the dates on at the end:

LEFT JOIN ([Crudo de Incidentes])
LOAD the key field or fields to the table,
Year ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Año,
Month([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Mes,
Day  ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Dia,
Hour ([Inicio de Afectacion|Inicio de la interrupcion de servicio]) as Hora
RESIDENT [Crudo de Incidentes]
;

Not applicable
Author

Thanks a lot again, It works.....