Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_puccetti
Partner - Creator
Partner - Creator

Round number

Why this statement return me a number like this 12.123?

This is the statement:

=Num(Avg(Date(DT_ATTIVAZIONE_CONTO) - Date(DT_APERTURA_CONTO,'DD-MM-YYYY')),'##.##')

Thanks

Marco

1 Solution

Accepted Solutions
Kushal_Chawda

Use floor or round on top of the Avg

or

use num( avg( expression) ,'00')

View solution in original post

6 Replies
swuehl
MVP
MVP

Because QV handles dates as dual values with a text and a numeric representation.

Aggregating a date difference using avg() will return a number, and num() will format the number according the format code.

sivarajs
Specialist II
Specialist II

use Num(exp,'#,##0')

marco_puccetti
Partner - Creator
Partner - Creator
Author

For other number it works like this, truncating the number:

=Num(Avg(Date(DATA1) - Date(DATA2,'DD-MM-YYYY')),'##')

but it still continue to add a decimal value like: 11.2


Any solution?

Thanks

Marco

sivarajs
Specialist II
Specialist II

In properties, fix the number format to integer in  number tab and check.

Kushal_Chawda

Use floor or round on top of the Avg

or

use num( avg( expression) ,'00')

marco_puccetti
Partner - Creator
Partner - Creator
Author

Ok

Thanks

Marco