BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Betty_sam
Obsidian | Level 7

Hi,

 I would like to calculate the median duration for d-1 excluding flag=0.

 I don't want to use the filter in the menu Betty_sam_0-1654767720937.pngfor the date and the flag.

 

Any help please ? 

 

Thanks in advance. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarkusWeick
Barite | Level 11

Hi @Betty_sam,

if you really just want to have the median for “today-1”, there is way:

Bruehl_0-1654845314502.png

 

 

You could create a calculated item, which contains values only for yesterdays durations with flag = 1:

Bruehl_1-1654845314632.png

(To get the "Missing" into the ELSE-cell you have to insert a dot ".")

 

For this column then you set the format to “elapsed time” and the aggregation to “median”:

Bruehl_2-1654845314695.png

 

 

With a list table with the new column as only column you get the following result:

Bruehl_4-1654845425216.png

 

Does this meet your requirements?

Best

Markus

 

 

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles

View solution in original post

7 REPLIES 7
MarkusWeick
Barite | Level 11

Hi @Betty_sam,

could you please add some sample data and your VA version number?

Best

Markus

 

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
Betty_sam
Obsidian | Level 7

Hi @MarkusWeick,

I am using SAS VA 8.5.2 , SAS VIYA 03.05

Here is some simple data : 

 

Betty_sam_0-1654777938156.png

Thanks

MarkusWeick
Barite | Level 11

Hi @Betty_sam,

another question: what do you mean with "d-1"?

Best

Markus

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
Betty_sam
Obsidian | Level 7

today-1 , in this example it will be 08/06/2022

MarkusWeick
Barite | Level 11

Hi @Betty_sam,

I had been workung with the Aggregated Operators in Calculated Items lately (though in VA 7.5) and hoped to find a solution using these. But it didn't work. Sorry!

Best Markus

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
MarkusWeick
Barite | Level 11

Hi @Betty_sam,

if you really just want to have the median for “today-1”, there is way:

Bruehl_0-1654845314502.png

 

 

You could create a calculated item, which contains values only for yesterdays durations with flag = 1:

Bruehl_1-1654845314632.png

(To get the "Missing" into the ELSE-cell you have to insert a dot ".")

 

For this column then you set the format to “elapsed time” and the aggregation to “median”:

Bruehl_2-1654845314695.png

 

 

With a list table with the new column as only column you get the following result:

Bruehl_4-1654845425216.png

 

Does this meet your requirements?

Best

Markus

 

 

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
Betty_sam
Obsidian | Level 7

Hi @MarkusWeick,

 

Its working, thank you very much

 

Best regards

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 3291 views
  • 4 likes
  • 2 in conversation