Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between # and normal functions

Hello all,

Can anybody explain in the following in brief:

time vs time#

date vs date#

num vs num#

timestamp vs timestamp#

Thanks in advance

6 Replies
tresesco
MVP
MVP

Basically,

Num() - changes format only (without making any change in the original backend data)

Num#()  - parses/reads the data according to mentioned format.

Read this: Re: Num  vs num #

The rest are similar.

danieloberbilli
Specialist II
Specialist II

time() is only about the format (kind of 'layouting' the value)

time#() is about interpreting...telling QlikView that this string is actually a Time/Date/Timestamp...  only if QlikView interprets a field/value correctly you can use it properly and formatting it with time()

Not applicable
Author

num()chnages the format,num#()changes the data according given format

Not applicable
Author

time() changes the time format

ashfaq_haseeb
Champion III
Champion III

MK_QSL
MVP
MVP

Date#()  is used to convert a Text/String into a Number with a specific format

Date( )  is used to format a number to specific format

Look at the below example...

Considering you have below Default Date Format in you script

SET DateFormat='DD/MM/YYYY';

Now Take an example of below sample code

Load * Inline

[

  InvoiceDate

  14-05-2014

];

Create a Text Box in your UI and write below

=NUM(InvoiceDate)

You will get - even though QlikView consider InvoiceDate as Number

Because your default date format is DD/MM/YYYY and QlikView can't match DD-MM-YYYY and DD/MM/YYYY. So we need either to change the Default Date Format or need to tell QlikView that InvoiceDate is actually a Date.. How?

Use below in your Script

Load

Date(Date#(InvoiceDate,'DD-MM-YYYY'))  as InvoiceDate

Inline

[

  InvoiceDate

  14-05-2014

];

This will convert InvoiceDate to the Date Format as per your Script... i.e. 14/05/2014

Now if use =NUM(InvoiceDate) in you text box you will get actual number corresponds to the InvoiceDate

We can directly use as below in your Text Box

=NUM(Date#(InvoiceDate,'DD-MM-YYYY'))

============================================

Same way we can use TimeStamp, Time and Num....

Hope this would be helpful...