Skip to main content
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: 
yanivvl0
Creator III
Creator III

How to use dates interval as dimension ?

hi to all ,

i have Projects table with start_date field for each project .   for each project there are many Registrations in  Registrations Table with start_date field for each Registration.  i need to count the number of Registrations ( for each Project ) accordind to the interval days btween Project start_date and Registrations start_date .

for example:

interval  of 1 day - project 10 have 100 Registrations  , roject 20 have 150 Registrations .

interval  of 2 day - project 10 have 60 Registrations  , project 15 have 200 Registrations  , roject 20 have 30 Registrations .

...

i tried using aggr in calculated dimension but there is  a problem when compute the interval days ,

thanks.

1 Solution

Accepted Solutions
PradeepReddy
Specialist II
Specialist II

might be like this...

Dimension: Class(ProjectDate-RegistrationDate,5)

Expression : count(distinct RegistrationId)

If this is not what you are expecting, post the expected output...

View solution in original post

10 Replies
tresesco
MVP
MVP

I guess you are on right track. Could you post a sample and explain the issue?

yanivvl0
Creator III
Creator III
Author

hi tresesco , here is demo data , thanks.

Not applicable

hi yaniv:

Use a chart object (instead of a table box) and use the calculated dimension:

=floor(ProjectDate-RegistrationDate)

Use an expression of

=count(RegistrationID)

This will yield registrations by interval before project per your sample data. Sample QVW attached.

tresesco
MVP
MVP

And how would be your expected output?

PradeepReddy
Specialist II
Specialist II

might be like this...

Dimension: Class(ProjectDate-RegistrationDate,5)

Expression : count(distinct RegistrationId)

If this is not what you are expecting, post the expected output...

yanivvl0
Creator III
Creator III
Author

like that :

intervals wanted.PNG

tresesco
MVP
MVP

May be like attached.

yanivvl0
Creator III
Creator III
Author

hi Greg , so simple and so smart - thanks for the great answer !!

yanivvl0
Creator III
Creator III
Author

Hi Tresesco , Great answer, thanks !!