# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for
Did you mean:
Highlighted
Creator II

## How to convert 0.25 to 3 months and 0.75 to 9 months?

Hello fellow developers,

I have a list box contaoning values like 0.25,0.75,1,1.50 ....etc they represent years.

I want to display 3 months instead of 0.25

How can this be done.

Thanks

B

1 Solution

Accepted Solutions
Highlighted
Creator III

## Re: How to convert 0.25 to 3 months and 0.75 to 9 months?

Don't know if this is the MOST elegant way, but a calculated dimension with something like this:

=FLOOR(Period) & ' Years ' & (Period - FLOOR(Period))*12 & ' Months'

That should do the trick.

5 Replies
Highlighted
Creator III

## Re: How to convert 0.25 to 3 months and 0.75 to 9 months?

Don't know if this is the MOST elegant way, but a calculated dimension with something like this:

=FLOOR(Period) & ' Years ' & (Period - FLOOR(Period))*12 & ' Months'

That should do the trick.

Highlighted
Creator II

## Re: How to convert 0.25 to 3 months and 0.75 to 9 months?

Thank you Aron..that was perfect

Highlighted
Creator II

## Re: How to convert 0.25 to 3 months and 0.75 to 9 months?

For some reason I'm not able to sort the result in ascending or descending order...I want to sort it in ascending order..any suggestions

Highlighted
Creator III

## Re: How to convert 0.25 to 3 months and 0.75 to 9 months?

So leave the calculated dimension alone.  Go to the Sort tab and check "Expression".  In the edit box use whatever your field name is (I used "Period" in my example).

=Period

Then you can select Ascending or Descending.

Hope that helps.

Highlighted
Creator II

## Re: How to convert 0.25 to 3 months and 0.75 to 9 months?

Aron,

That was a  perfect solution.

Thanks

B