J Zhou Posted October 4, 2021 Share Posted October 4, 2021 How do you add a calculated column that identifies within the same groups of [WheelsetNumber], there is differing [W05Wheelset] values within the rows E.g. WheelsetNumber 100009 has KCLASS and GSHORT strings, I'd like it to return '1'. As opposed to 100920, where I want it to return '0' as all rows for 100920 have the same KCLASS strings in the [W05Wheelset] column. For wheelset numbers with one row, such as 100011, I want it to return '0' as well I know I need to use a mixture of OVER functions but I'm out of my depth. Any help appreciated :) Link to comment Share on other sites More sharing options...
Fabian Duerr Posted October 7, 2021 Share Posted October 7, 2021 First, get the number of unique W05 per WheelsetNumber: UniqueCount[W05Wheelset] OVER [WheelsetNumber]As you only want to return 0 or 1 (if more than one unique W05) you can expand this: If(UniqueCount[W05Wheelset] OVER [WheelsetNumber] = 0, 0, 1) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now