Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
bartwelvaarts
Contributor III
Contributor III

Count dates from min(date)

Hi Qlik community,

I want to count the number of dates that surpassed a certain minimal date per project. See the example below. With my current calculation it takes the date of the lowest date there is and apply this to all projects. But I want to calculate the minimal date of each project and then count the dates. 

Hopefully someone can help me!

bartwelvaarts_0-1665562108456.png

 

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

 

 

sum(aggr(if(Dateis>min(total<project> PlannedDate),1,0),project,Dateis))

vinieme12_0-1665569458948.png

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
SamuelHaag
Contributor III
Contributor III

Hi,

maybe you can calculate it in the script?

Example:

[DATES]:
Load * Inline [
Project, Date, Planned_Date
A,08.10.2022, 10.10.2022,
A,11.10.2022
A,12.10.2022
A,13.10.2022
B,09.11.2022, 12.11.2022
B,10.11.2022
B,11.11.2022
B,12.11.2022
];


Left join ([DATES])
Load
Project,
date(min(Planned_Date)) as MinPlanedDatePerProject
Resident [DATES] Group By Project;


Left join ([DATES])
Load
*,
(if(Date >= MinPlanedDatePerProject,1,0)) as DesiredOutput
Resident [DATES];

Drop Field Planned_Date;

You will recieve:

12-10-_2022_10-58-01.jpg

 

Kind regards

 

Samuel

vinieme12
Champion III
Champion III

 

 

sum(aggr(if(Dateis>min(total<project> PlannedDate),1,0),project,Dateis))

vinieme12_0-1665569458948.png

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.