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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Marcushenriquesk
Creator
Creator

Set analysis how do i include only records with date field greater than another

I have this measure to calculate the average difference of time between run date and received date:

=avg(aggr(Sum({<[PANEL_ID]-={">=30000<=39999"},[ORG_ID-REG_ORG_ID]-={"1,6"},[TEST_ID]-={">=90000<=99999"}, [RUN_DATE_TIME]={">=$([RECEIVED_DATE_TIME])"}>}RUN_DATE_TIME-RECEIVED_DATE_TIME) ,ACC_ID))

I am trying to add something to the set analysis that only includes run_dates that are greater than the received date. I am trying this:

[RUN_DATE_TIME]={">=$([RECEIVED_DATE_TIME])"}

but it doesnt seem to be working there are still negative difference being included in the output of the function. 

4 Replies
Thiago_Justen_
MVP
MVP

Hi there.

Just replace from this [RUN_DATE_TIME]={">=$([RECEIVED_DATE_TIME])"} to this [RUN_DATE_TIME]={"=[RUN_DATE_TIME]>=[RECEIVED_DATE_TIME]"}

Hope it helps you.

 

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Marcushenriquesk
Creator
Creator
Author

I attempted this but it is not working properly, not sure why, it removed the negatives but the averages are like 0.1 hours when the qa team is giving me numbers around 4-5 hours.

Marcushenriquesk
Creator
Creator
Author

=avg(aggr(Sum({<[RUN_DATE_TIME]={"=[RUN_DATE_TIME]>=[RECEIVED_DATE_TIME]"}, [ORG_ID-REG_ORG_ID]-={"1,6"}>}RUN_DATE_TIME-RECEIVED_DATE_TIME), ACC_ID)) 

 

Here is what i have now. its so weird but some dates just have no data populating at all now. and also the numbers seem to be a lot lower than the predicted averages. 

Marcushenriquesk
Creator
Creator
Author

is it because the set analysis is on the sum level and not removing each ACC_ID that has a run date less than received date