BookmarkSubscribeRSS Feed
Neil19
Calcite | Level 5

Hi,

 

I'm quite new to SAS and I'm trying to perfrom a sumif function on a data set in DI, but I cant find an equivalent procedure / code that would help me with this. I have the data set below.

 

Bucket ABucket BValue
11010
2106
3103
1209
2205
3202
1308
2304
3301

 

I want to add a column to sum the values >= Bucket A, but also to exclude the values of the previous row, so I've used a SUMIF with reative referencing.  For example, the fourmula in cel D2 is, =SUMIF(A2:A10,">="&A2,C2:C10) = 48.

 

Bucket ABucket BValuesumif (>=A)
1101048
210621
31036
120929
220512
32023
130813
23045
33011

 

Is there a way to recreate this in SAS and DI?

 

Many thanks,

Neil

1 REPLY 1
LinusH
Tourmaline | Level 20

Hi,

I can understand you might have problems grasping DI if you use Excel as a reference.

DI Studio is used for standardised ETL, where the target are detail data layers, data marts and similar.

 

But your requirement doesn't look like a generic table structure, feels like a report to me. Or what is the application? Sorry, I can't the logic/use of the caclulated column. Please elaborate about the data flow and use.

Perhaps this is better suited for a report tool, like a stored process.

 

If you need to perform this in DI, my gut feeling is that you need some kind of user written code.

Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 962 views
  • 0 likes
  • 2 in conversation