|
|
|
Уникальные значения
|
|||
|---|---|---|---|
|
#18+
Подскажите пожалуйста, как в сводной таблице, источником для которой является база данных, посчитать уникальные значения? На стороне базы использовать Distinct count не проходит. Считать уникальные значение нужно только в сводной таблице. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 18.04.2006, 19:21:04 |
|
||
|
Уникальные значения
|
|||
|---|---|---|---|
|
#18+
Мало подробностей. если все-таки на стороне базы и вопрос об SQL, то должно проходить select count(distinct ID) from Table1. Но если не работает, можно попробовать так select count (q.ID) from (select ID from Table1 group by ID) q Если Access то подзапрос q придется сохранить отдельно и select count (q.ID) from q ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.04.2006, 11:45:05 |
|
||
|
Уникальные значения
|
|||
|---|---|---|---|
|
#18+
может это поможет удаление повторяющихся записей? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.04.2006, 11:51:59 |
|
||
|
Уникальные значения
|
|||
|---|---|---|---|
|
#18+
Объясню более подробней: Из SQL Server выбирается табличка такого вида(она же является источником для сводной таблицы): Имя1 10.01.06 25 Имя2 10.02.06 11 Имя1 15.02.06 30 Имя3 16.02.06 21 Имя2 17.02.06 19 В сводной таблице, даты будут находится в области фильтра. Так вот в случае если в датах мы выбрали уровень (Все) или (All) мне необходимо посчитать Distinct Count по полю имя. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.04.2006, 12:53:04 |
|
||
|
Уникальные значения
|
|||
|---|---|---|---|
|
#18+
select count(distinct name) from Table1 работает и возвращает 3 по данным вашего примера (name -"имя1" и т.д). Все было описано в моем предыдущем посте ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.04.2006, 13:07:45 |
|
||
|
Уникальные значения
|
|||
|---|---|---|---|
|
#18+
авторJohn has a worksheet that he uses for registration of attendees at a conference. Column A has a list of each person attending, and column B has the company represented by each attendee. Each company can have multiple people attend. John can easily figure out how many individuals are coming to the conference; it is simply the number of rows in column A (minus any header rows). The more difficult task is to determine how many companies are going to be represented at the conference. There are a couple of ways to determine the desired count. First, if there are no blank cells in column B, you can use an array formula (entered by Ctrl+Shift+Enter) such as the following: =SUM(1/COUNTIF(B2:B50,B2:B50)) авторIf there are blanks in the range (B2:B50 in this case), then the array formula will return a #DIV/0! error. If that case, the array formula needs to be changed to the following: =SUM(IF(FREQUENCY(IF(LEN(B2:B50)>0,MATCH(B2:B50,B1:B50,0),""),IF(LEN(B2:B50)>0,MATCH(B2:B50,B2:B50,0),""))>0,1)) авторIf you prefer to not use an array formula, you can add regular formulas to column C to do the count. First, sort the table of data by the contents of column B. That way the data will be in company order. Then add a formula such as the following to cell C2 (assuming you have a header in row 1): =IF(B2<>B3,1,0) авторCopy the formula down through all the rest of the cells in column C, and then do a sum on the column. The sum represents the number of unique companies attending, since a 1 only appears in column C when the companies change. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.10.2006, 15:09:21 |
|
||
|
|

start [/forum/search_topic.php?author=Masik&author_mode=last_posts&do_search=1]: |
0ms |
get settings: |
8ms |
get forum list: |
15ms |
get settings: |
9ms |
get forum list: |
18ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
50ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
48ms |
get tp. blocked users: |
1ms |
| others: | 711ms |
| total: | 878ms |

| 0 / 0 |
