Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
kartik
Contributor III
Contributor III

What are the potential use case scenarios for combination of Num(Floor ()) ?

I'm confused about when to use num(floor ()) function and what is the use of this?

let's say I have one sale end date is 20220222 and Receiving end date 20190826. So, if I do the num(floor ()) function with both the date and difference it. It will give me 29396  What does this mean? What is the significance of doing this?

 

Labels (1)
  • QMC

2 Solutions

Accepted Solutions
hic
Former Employee
Former Employee

20220222 - 20190826 is 29396  

Here you have two numbers, both around 20 million, and you calculate the difference. This is meaningless if the two are dates.

You need to interpret the two as dates before you do anything. I.e.

Date#(Date1,'YYYYMMDD') - Date#(Date2,'YYYYMMDD') as Diff,

See more on https://community.qlik.com/t5/Qlik-Design-Blog/The-Date-Function/ba-p/1463157 

The Num() and Floor() do not affect anything - The first formats as a number, the second rounds downwards. But since the subtraction already returns integer numbers, nothing is changed.

View solution in original post

Andrei_Cusnir
Specialist
Specialist

Hello,

 

Maybe someone with more BI experience can provide additional helpful information here. But I was unable to find a significant meaning behind the difference of those 2 numbers. 

 

Either you use the combination of Num(Floor()) functions or not, the result of expression 20220222 - 20190826 will still be: 29396. However, what exactly this number represents, I was unable to find. 

 

Regarding the use of the functions and the combination of both, I would say that you can probably make a use of them in various use case scenarios. Here is an example of how these functions work together:

IMAGE

 

As you can see:

  • Simple division will give you a huge number with many decimal places
  • Using the Floor() [1] function, you can remove entirely the decimal point or you can limit the decimal points by using another argument.
  • If you use a combination of both functions without providing any new arguments, then there are no differences to the result
  • However, if you use the Num() [2] function with additional argument, you can then format the result by calculating '%' or adding ',' separator etc.

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 

---

[1] https://help.qlik.com/en-US/sense/November2021/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Gener...

[2] https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/FormattingFunct...

 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

2 Replies
hic
Former Employee
Former Employee

20220222 - 20190826 is 29396  

Here you have two numbers, both around 20 million, and you calculate the difference. This is meaningless if the two are dates.

You need to interpret the two as dates before you do anything. I.e.

Date#(Date1,'YYYYMMDD') - Date#(Date2,'YYYYMMDD') as Diff,

See more on https://community.qlik.com/t5/Qlik-Design-Blog/The-Date-Function/ba-p/1463157 

The Num() and Floor() do not affect anything - The first formats as a number, the second rounds downwards. But since the subtraction already returns integer numbers, nothing is changed.

Andrei_Cusnir
Specialist
Specialist

Hello,

 

Maybe someone with more BI experience can provide additional helpful information here. But I was unable to find a significant meaning behind the difference of those 2 numbers. 

 

Either you use the combination of Num(Floor()) functions or not, the result of expression 20220222 - 20190826 will still be: 29396. However, what exactly this number represents, I was unable to find. 

 

Regarding the use of the functions and the combination of both, I would say that you can probably make a use of them in various use case scenarios. Here is an example of how these functions work together:

IMAGE

 

As you can see:

  • Simple division will give you a huge number with many decimal places
  • Using the Floor() [1] function, you can remove entirely the decimal point or you can limit the decimal points by using another argument.
  • If you use a combination of both functions without providing any new arguments, then there are no differences to the result
  • However, if you use the Num() [2] function with additional argument, you can then format the result by calculating '%' or adding ',' separator etc.

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 

---

[1] https://help.qlik.com/en-US/sense/November2021/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/Gener...

[2] https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/FormattingFunct...

 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂