Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

difference in days in straight table

Hi All,

I got a requirement as follows:

i have a data in straight table with 3 columns old brand,new brand and their brand dates.

Now i want one more column as difference in days when compared to below row date in a date column.

For example:

oldnewdatedifference(Days)
prod aban a24/06/201414
prod bban b08/07/20140
prod cban c08/07/201428
prod dban d05/08/201422
prod ebane27/08/20149
prod fban f05/09/20144
prod gban g09/09/2014-

In the above table, i want to show difference(Days) column in qlikview.

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

The basic expression is as follow:

below( total Date,1,1) - Date

The 'TOTAL' is key so that it looks over all dimensions and not restricted to the current rows dimensional value

To ensure your values are read as a date you below( total Date,1,1) - Date can try the following as well based on the format you posted above:

below (  total  date(date#(Date, 'DD/MM/YYYY')) , 1, 1)  -  date(date#(Date, 'DD/MM/YYYY'))

View solution in original post

6 Replies
PrashantSangle

Hi,

Use Interval(DateField-below(DateField),'D')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

HI Max,

I tried with your solution but it is showing '-' in the table column.

senpradip007
Specialist III
Specialist III

PFA. Hope it will help.

PrashantSangle

Hi,

Try this

Interval(Date(DateField-Above(DateField)),'D')

Check DateField Format

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

HI,

can anyone help me on this i am missing out something.

JonnyPoole
Employee
Employee

The basic expression is as follow:

below( total Date,1,1) - Date

The 'TOTAL' is key so that it looks over all dimensions and not restricted to the current rows dimensional value

To ensure your values are read as a date you below( total Date,1,1) - Date can try the following as well based on the format you posted above:

below (  total  date(date#(Date, 'DD/MM/YYYY')) , 1, 1)  -  date(date#(Date, 'DD/MM/YYYY'))