Topic Options
#56211 - 08/08/18 03:38 AM Counter for identical Data
fwenger Offline
OL Newbie

Registered: 08/08/18
Posts: 1
Im looking for a expression, that increments a counter, if a datafield dont change.
For example, my table has a ID and a Value:
ID Value
15 xy
15 zt
15 ou
17 ff
17 ds

The counter should count the identical IDs and looks like this:

I read already about a macro in topic "[Macro] Check if data in a field changes", but there is no code inside. Also i read about a Expression IF(CHANGED([ID]),... but that Keyword dont want work in my PSM 6.1.1.

Is there any way to do that without a Excel-handling?

#56214 - 08/09/18 11:02 AM Re: Counter for identical Data [Re: fwenger]
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 186
Loc: Objectif Lune NL
I think CHANGED only works in PSM 7.

You could write a macro for PSM 6 that would give you the "1" part of "1/3", but unfortunately I can't think of any way to get the "3" part of "1/3". You can look back to what you encountered before, but there is no way to look ahead.

#56215 - 08/09/18 11:20 AM Re: Counter for identical Data [Re: fwenger]
Jean-Cédric Online   happy
OL Expert

Registered: 10/03/16
Posts: 287
Loc: Québec, Canada
You could try to read your Excel sheet from an ODBC driver as a database and while you are extracting, use SQL to gather the number of each similar ID and add this as a new field that will be used as X of 1/X.