Kreuzungsleistung auflistenHier ist ein
Frage an alle JSL-Assistenten.
ich habe text
Daten, die ich auf unterschiedliche Weise gruppieren muss.
style="">
Meine Tabelle sieht so aus:
style="font-weight: bold; text-decoration: underline; font-family: monospace;">My
Wertkategorie 1
Kategorie 2 Kategorie 3
style="font-family: monospace;">
AA
1
1
0
style="font-family: monospace;">
BB
0
1
0
style="font-family: monospace;">
CC
1
0
0
style="font-family: monospace;">
DD
0
1
0
style="font-family: monospace;">
EE
1
0
0
style="font-family: monospace;">
FF
0
0
0
style="font-family: monospace;">
AA
1
1
0
style="font-family: monospace;">
BB
0
1
0
style="font-family: monospace;">
GG
0
0
0
style="font-family: monospace;">
HH
0
0
1
style="font-family: monospace;">
MM
0
1
1
Die Kategorie
Spalten ermöglichen es mir, die Daten auf verschiedene Weise zu gruppieren.
style=""> Der
Kategorien für dieses Beispiel stammen aus der
folgende Listen:
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">Kategorie
1
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
{
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"AA"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"CC"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"EE"
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">}
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">Kategorie
2
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
{
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"AA"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"BB"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"DD"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"MM"
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">}
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: schwarz;">Kategorie
3
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: schwarz;">
{
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: lila;">"KK"
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: lila;">"MM"
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: schwarz;">}
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; color: navy;">;
Wenn du bist
Ich frage mich, warum ich nicht nur eine Kategoriespalte hinzufüge,
es ist, weil es sein kann
Überschneidungen in den Kategorielisten.
Also ich
benötigen für jede Kategorie eine eigene Spalte.
Wenn ein Wert
in dem MyValue
Spalte entspricht a
Wert in einer Kategorieliste, dann ist die Kategoriespalte 1, sonst ist es
ist 0.
Dadurch kann ich schnell separate Analysen der Daten durchführen
passend zu jeder Kategorie.
Mein Problem
ist eine Leistung bei der Berechnung der Kategoriespalten.
style=""> Es ist
nicht schlecht für kleine Tabellen (10.000 Zeilen, 3 .)
Kategorien, kleine Kategorielisten).
style="">
Es bleibt jedoch hängen
für größere Datensätze (300.000 Zeilen, 200 .)
Kategorien, große Kategorielisten).
style=""> Manche
der Kategorielisten können recht groß sein (2000 Werte).
Grundsätzlich bin ich
brauchen einen schnellen Weg, um eine Art Listenschnitt zwischen den Daten durchzuführen
in dem Mein Wert
Spalte und die Daten in jedem
Kategorieliste.
Das ist ganz einfach
Beispiel, aber es veranschaulicht das Konzept.
Hier ist die
Logik verwende ich für eine Kategorie.
style=""> Der
Möglichkeit, Übereinstimmungen zwischen einer Liste und einer Spalte zu finden mit
style="">AUSWÄHLEN WO
ist sehr mächtig.
Wenn es irgendwie beschleunigt werden kann
Ich würde gerne wissen wie!
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">one_category
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"Kategorie
1"
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">category_list
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
{
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"AA"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"CC"
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: lila;">"EE"
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">}
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">nr
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">nrows
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">dt )
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">col_zeroes
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">j
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">nr
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">1
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">0
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">)
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: grün;">//
Kategoriespalte hinzufügen
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">dt
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;"><<
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">new
Säule
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">one_category
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
numerisch )
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">column
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">dt
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
eine_kategorie )
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;"><<
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
verbergen (
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">1
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">)
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: grün;">//
Setzen Sie die gesamte Spalte auf
Nullen am Anfang
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">column
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">dt
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
eine_kategorie )
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;"><<
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
Werte ( col_zeroes [
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">0
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">1
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">])
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: grün;">//
Alle Zeilen mit Werten auswählen
passend zu dieser Kategorie
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">dt
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;"><<
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
wählen wo (
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">enthält
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">category_list
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">:
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">My
Wert ))
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: grün;">//
Erhalten Sie eine Liste der ausgewählten
Reihen
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">one_cat_rows
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
dt
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;"><<
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
werde ausgewählt
Reihen ()
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: grün;">//
Setzen Sie alle übereinstimmenden Zeilen auf 1 für
diese Kategorie
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">if
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
(
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">nrows
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">one_cat_rows )
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">>
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">0
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">column
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">(
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">dt
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">,
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
eine_kategorie )[ one_cat_rows ]
style="font-size: 10pt; font-family: "Courier New"; Farbe: navy;">=
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; font-family: "Courier New"; Farbe: blaugrün;">1
style="font-size: 10pt; font-family: "Courier New"; color: navy;">;
style="font-size: 10pt; font-family: "Courier New"; Farbe: schwarz;">
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; Farbe: schwarz;">)
style="font-size: 10pt; line-height: 115%; font-family: "Courier New"; color: navy;">;