Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

s_santalucia
Contributor

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
MVP
MVP

Re: From day to month

Your optimal solution could maybe be achieved using

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

8 Replies

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?

s_santalucia
Contributor

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

MVP
MVP

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:

LOAD

     Days,

     Days / 30.5 as Months,

     ....

s_santalucia
Contributor

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                    ....

s_santalucia
Contributor

Re: From day to month

Thank you!

MVP
MVP

Re: From day to month

Your optimal solution could maybe be achieved using

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

s_santalucia
Contributor

Re: From day to month

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

thank you

Community Browser