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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
sonicarm22
Contributor III
Contributor III

Contar los días de la semana

¡Hola a todos!

Por favor, alguien puede ayudarme con una función que cuente los días que tiene la semana. Esto lo necesito básicamente para el inicio y fin de año, ya que no me sirve dividir por 7, sino que necesito dividir por los días reales.

Gracias de antemano.

Labels (2)
1 Solution

Accepted Solutions
sonicarm22
Contributor III
Contributor III
Author

Muchas gracias a todos, ya encontré la respuesta. 

Era muy sencilla, la verdad. Que pena.

Bastaba con contar los días en los que se registraban valores al inicio y al fin del año. Porque efectivamente, para todas las semanas intermedias, es decir, las que no son la 1 y la 52 o 53, shay 7 días.

 

Gracias.

View solution in original post

3 Replies
Andrei_Cusnir
Specialist
Specialist

Hello I had to translate the details in English so the translation might not be accurate, which means that I might have misunderstood the requirement. Please check the following details:

1. If your dataset looks like:

 

2. Then you can do something like that:

=date('2/7/2022','MM/DD/YYYY')- date('2/3/2022','MM/DD/YYYY') // Change the first part of each function to the date field of course. So in case you know the start date and end date you can calculate the number of days between them

 

3. Or if you want you can use:

=DayNumberOfYear('11/1/2022') // Which will give you the exact day number of the day within the year.

 

Output:

 

NOTE: The requirement that was unclear to me after translation is: "... a function that counts the days of the week". Perhaps the information above can help you use the mentioned functions in your use case scenario to make the needed calculations.

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
NadiaB
Support
Support

Hola @sonicarm22 

Te refieres a contar 1,2 ,3, 4....7 the lunes a domingo ? O cual calculation deseas obtener? Quiza un ejemplo prodria ayudar a entender mejor que es lo que intentas calcular. 

Mientras tanto las funciones de fecha y tiempo se encuentran en nuestro portal en la siguiente seccion:

https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunc...

Saludos !!

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
sonicarm22
Contributor III
Contributor III
Author

Muchas gracias a todos, ya encontré la respuesta. 

Era muy sencilla, la verdad. Que pena.

Bastaba con contar los días en los que se registraban valores al inicio y al fin del año. Porque efectivamente, para todas las semanas intermedias, es decir, las que no son la 1 y la 52 o 53, shay 7 días.

 

Gracias.