8 Replies Latest reply: Mar 27, 2018 10:03 AM by Stefania Santalucia

# 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

• ###### Re: From day to month

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?

• ###### Re: From day to month

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

• ###### Re: From day to month

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

• ###### Re: From day to month

The optimal solution would be:

Days               Months

50                  1 month and 20 day

31                  1 month and 1 day

61                    ....

60                         ....

90                         ...

91                    ....

• ###### Re: From day to month

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:

Days,

Days / 30.5 as Months,

....

• ###### Re: From day to month

Thank you!

• ###### Re: From day to month

Your optimal solution could maybe be achieved using

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

• ###### Re: From day to month

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

thank you