Discussion board where members can get started with Qlik Sense.
I would ask you which is the right way to transform a certain amount of Months (this is a Payback period expressed in Months) in the same amount expressed in Year and Months.
For example 52 Months = 4 years and 4 months.
It is a silly thing but I don't know how I can do it.
Thanks in advance for your support
Not sure how exactly you are wanting to represent the years and months. If you are wanting to break down to a year field and month field the below will work, you can then combine back if needed.
If 'Payback' is the field name of your number of months.
Calculate Years = floor(Payback/12)
Calculate Months = Payback- floor(Payback/12)*12
Hope that makes sense and is helpful.
Floor((52/12))&' Years and ' & mod(52,12)&' months'
I think round will not work use floor in that place.
floor((52/12))&' Years and ' & mod(52,12)&' months'
Thank you very much to everybody!!!
All your suggestion are right and the KPI is working!