BookmarkSubscribeRSS Feed
FBAC
Calcite | Level 5

Data items:

  1. tsstate_datetime (in minutes)
  2. cat_latency_groepen (categorie, 7 groups)
  3. aantal (count per group).

 

I like to calculate percentage of the first group (lat_0_2) of the total per datetime value( minute, hour, day etc.)

 

Although I now how to do it in normal SAS code, using the 'New data item ' window isn't straightforward at all.

 

The function should be something like:

SUM(IF ('cat_latency_groepen'n IN ('lat_0_2'), 'aantal'n, 0)) / SUM('aantal'n) * 100

 

I also tried using IF....ELSE operator as well but that starts off with a IF underneath red. I have no clue using this operator in this interface. And I can't find any helpfull documentation. 

 

What would be the best practice using this interface?

 

 

SAS2.JPG

SAS1.JPG

 

1 REPLY 1
FBAC
Calcite | Level 5

This seems to work: 

 

Sum(ByGroup, IF In(cat_latency_groepen, 'lat_0_2') RETURN aantal ELSE 0) /Sum(ByGroup, 'aantal'n)