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: 
s_santalucia
Partner - Creator
Partner - Creator

From day to month

Hi all,

is it possible to turn the day in month with Qlik Sense function?

Ex:

I have 50 days, how many months do they match?


Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Your optimal solution could maybe be achieved using

= Div(Days,30) & ' month(s) and ' & Mod(Days,30) & ' day(s)'

View solution in original post

8 Replies
sunny_talwar

What would be the correct answer here? I mean days vary from month to month. What if you have 31... is that 1 month or 1 month and 1 day?

s_santalucia
Partner - Creator
Partner - Creator
Author

I want formula that turn day in month!!!!!

sunny_talwar

I understand... but can you tell me what the answers for these need to be? I am just trying to understand the logic

Days               Months

50

31

61

60

90

91

Fill in the blanks

swuehl
MVP
MVP

Stefania,

there is no common definition how to translate days to months, you would need to specify your definition / requirement.

For examples, have a look at

How Do I Get the Number of Months Between Two Dates?

edit: if you only have the number of days, no dates to work with, I would probably just do an approximation using a division by 30.5:

LOAD

     Days,

     Days / 30.5 as Months,

     ....

s_santalucia
Partner - Creator
Partner - Creator
Author

The optimal solution would be:

Days               Months

50                  1 month and 20 day 

31                  1 month and 1 day

61                    ....    

60                         ....

90                         ...    

91                    ....

s_santalucia
Partner - Creator
Partner - Creator
Author

Thank you!

swuehl
MVP
MVP

Your optimal solution could maybe be achieved using

= Div(Days,30) & ' month(s) and ' & Mod(Days,30) & ' day(s)'

s_santalucia
Partner - Creator
Partner - Creator
Author

Great!!!!!!!!!!!!!!!!

thank you