Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Marcushenriquesk

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_

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
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
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
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