BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Lupo
Calcite | Level 5

Dear SAS Community member,

 

I am now dealing with a challenge that surprised me. Because i thought there was a simple solution for it 🙂

 

This is the case.

 

In SAS VA i like to caculate a new date by subtracting 6 months.

 

Date - 6months = new date.

 

Steps:
First i like to use treatas function to make the date numeric.

Then find a formula to subtract 6 months. This formula must take the diffrent numbers of days in the months into account.

 

Question:

Is there a formula which i can use in SAS VA which can calculate 6 months?

 

Remarks:

I do not use SAS Base.

 

Regards,

Lucien

1 ACCEPTED SOLUTION

Accepted Solutions
Lupo
Calcite | Level 5

Hello SurajSaini,

 

Thank you for the reply. It is indeed the challenge that the date is variable.
There fore i have implemented a simple solution.
With the "treat as" function i have changed to date into a number.
Dan subtract 180 days from it.

 

 The goal to warn the user that a depreciation date was coming within 6 months.
This information can be used for business purposes.

 

I will close this issue.

 

Regards, Lucien

View solution in original post

2 REPLIES 2
SurajSaini
Obsidian | Level 7

Can you please explain what you want to achieve in your analysis 

I do not have a solution to directly subtract a month from the date, because it's a bit hard to as you Date variable is not constant(I  just supposed so even if we create a date parameter in the calculation item still as the month varies in the date variable that will change the calculation results. 

 

If you do not mind can you please tell me what do you want to do in your reporting so that we can come_up with any other alternatives. 

Lupo
Calcite | Level 5

Hello SurajSaini,

 

Thank you for the reply. It is indeed the challenge that the date is variable.
There fore i have implemented a simple solution.
With the "treat as" function i have changed to date into a number.
Dan subtract 180 days from it.

 

 The goal to warn the user that a depreciation date was coming within 6 months.
This information can be used for business purposes.

 

I will close this issue.

 

Regards, Lucien

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 4202 views
  • 0 likes
  • 2 in conversation