Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Round up date calculation to whole number (for text objects)

I created a variable with the below formula: =vTotalWeeks

=(Date#([Project End Date], 'MMM DD, YYYY') - Date#([Project Start Date], 'MMM DD, YYYY')) / 7

It calculates correctly, but I need this to always round up to the next highest integer. So, 8.642343 should become 9.

Note: I am using text objects so I can't leverage the Number tab of a chart object.

11 Replies
Not applicable
Author

Hi Sunny, I tried your suggestion and you're right, it did return 35. Since the actual days are really 36, I then tried your next suggestion of adding 1 and this did end up returning my expected results for this one specific project. Thank you. I will monitor this for other projects with various project dates.

One last question if I could. Below formula is yielding .80294#######. I need it to return 80.29%. This is my 1st attempt at appending "1.00" at the beginning, so I know i am doing something just slightly wrong to not get the correct % format.

=1.00 - (num($(=$(vActualRev)) / sum([Original Rev Est]),'##.00%'))

sunny_talwar

To keep the formatting, you need to the Num() function around the complete calculations. Try something like this may be:

=Num(1.00 - ($(=$(vActualRev)) / Sum([Original Rev Est])),'##.00%')

Please check the parenthesis because I might have messed that up.