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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
judalkoby
Contributor
Contributor

Using interval function

Hello, 

I'm using a function Interval .

-Interval(Date_ConfirmDetails - Start_Station_Date,'D') as Days_In_Station, Num of days is correct!

Then, I'm trying to show in listbox my new field- I get a number if instances for each entry (instead one of each).

Or when I'm trying to make a table of  sum of Days_In_Station by ID , I get a strange number. (Big wrong number)

What's wrong with my code?

2 Replies
Ksrinivasan
Specialist
Specialist

hi,

find the example:

intervel match

Employee_age:
LOAD * INLINE [
Name, Age
John, 35
Katy, 26
William, 52
Barbara, 46
Erik, 18
];

 

Age:
LOAD *
INLINE [
MinAge, MaxAge
0, 17
18, 25
26, 30
31, 40
41, 50
51, 1000
];


IntervalMatch (Age)
Load
MinAge as Min_Age, /*------Rename to avoid synthetic keys---------*/
MaxAge as Max_Age
Resident
Age;

 

ksrinivasan.

marcus_sommer

Your date-fields are probably no dates else timestamps so that you get multiple numeric values for a certain as day formatted result. If so you need to remove the time-part and/or split dates and times - at best within the script with something like:

date(floor(FIELD)) as Date,
time(frac(FIELD)) as Time

- Marcus