cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-42138%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EErstellen%20Sie%20ein%20Tab-Feld%20mit%20einem%20Kreuz-Tab-Box-Design%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42138%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHallo%20zusammen%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIch%20bin%20mir%20nicht%20sicher%2C%20ob%20das%20m%C3%B6glich%20ist%2C%20aber%20ich%20versuche%20mein%20Gl%C3%BCck.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIch%20m%C3%B6chte%20(in%20jsl)%20eine%20Art%20Kreuztabellenfeld%20erstellen%2C%20aber%20mit%20meinen%20eigenen%20Werten%20anpassen.%20Zum%20besseren%20Verst%C3%A4ndnis%3A%3C%2FP%3E%3CP%3EHier%20ist%20eine%20Tabelle%20(ABB.%201)%20mit%20den%20Daten%2C%20die%20ich%20anzeigen%20m%C3%B6chte%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22FIG.%201%20-%20Tabulate%22%20style%3D%22width%3A%20714px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22FIG.%201%20-%20Tabulate%22%20style%3D%22width%3A%20714px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22FIG.%201%20-%20Tabulate%22%20style%3D%22width%3A%20714px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F6840iF9BE5209A840C29C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22wea00061%20-%20Connexion%20Bureau%20%C3%A0%20distance_4.jpg%22%20alt%3D%22FIG.%201%20-%20Tabulate%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFIG.%201%20-%20Tabulate%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFIG.%201%20-%20Tabulate%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFEIGE.%201%20-%20Tabellieren%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDas%20ist%20in%20Ordnung%2C%20aber%20nicht%20ganz%20das%2C%20was%20ich%20will.%20Was%20ich%20erhalten%20m%C3%B6chte%2C%20ist%20etwas%20%C3%84hnliches%20wie%20das%20Kreuztabellenfeld%2C%20das%20wir%20erhalten%2C%20wenn%20wir%20eine%20Kontingenzanalyse%20aufrufen%2C%20wie%20zum%20Beispiel%20in%20FIG.2%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22FIG.2%20-%20contingency%20table%22%20style%3D%22width%3A%20266px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22FIG.2%20-%20contingency%20table%22%20style%3D%22width%3A%20266px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22FIG.2%20-%20contingency%20table%22%20style%3D%22width%3A%20266px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F6839i03A87D8238253749%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22wea00061%20-%20Connexion%20Bureau%20%C3%A0%20distance_3.jpg%22%20alt%3D%22FIG.2%20-%20contingency%20table%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFIG.2%20-%20contingency%20table%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFIG.2%20-%20contingency%20table%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E%20ABB.2%20%E2%80%93%20Kontingenztabelle%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EABER%20statt%20%E2%80%9EAnzahl%E2%80%9C%2C%20%E2%80%9EGesamt%20%25%E2%80%9C%20usw.%20w%C3%BCrde%20ich%20in%20die%20Zellen%20die%20Mittelwerte%20eingeben%2C%20die%20meinen%20Analysespalten%20in%20tabellarisch%20entsprechen.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDie%20Funktionen%2C%20die%20mir%20an%20diesem%20Design%20gefallen%20und%20die%20ich%20in%20der%20tabellarischen%20Version%20nicht%20habe%2C%20sind%3A%3C%2FP%3E%3CP%3E-%20die%20M%C3%B6glichkeit%2C%20mehrere%20Werte%20in%20einer%20Zelle%20anzuzeigen%20(und%20eine%20Legende%20in%20der%20oberen%20linken%20Ecke%20anzuzeigen)%3C%2FP%3E%3CP%3E-%20die%20Schattierung%20der%20Spalten-%20UND%20Zeilen%C3%BCberschriften%3C%2FP%3E%3CP%3E-%20das%20Fehlen%20der%20%E2%80%9EMittelwert%E2%80%9C-Zeile%20unter%20den%20Spalten%C3%BCberschriften%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIch%20konnte%20keine%20M%C3%B6glichkeit%20finden%2C%20mein%20Tabulat%20mithilfe%20der%20Tab-Box%20in%20das%20umzuwandeln%2C%20was%20ich%20m%C3%B6chte.%20Glaubst%20du%2C%20dass%20es%20m%C3%B6glich%20w%C3%A4re%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDanke%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-42138%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EMassenanpassung%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-42218%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Erstellen%20Sie%20ein%20Tab-Feld%20mit%20einem%20Kreuz-Tab-Box-Design%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42218%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EAh%20ja.%20Die%20Funktion%20%E2%80%9EEinf%C3%BCgen%20in%E2%80%9C%20f%C3%BCr%20DisplayBoxes%20wurde%20erst%20in%20JMP%2013%20hinzugef%C3%BCgt.%20Ich%20freue%20mich%20zu%20h%C3%B6ren%2C%20dass%20dies%20f%C3%BCr%20Sie%20funktionieren%20wird.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-42216%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Erstellen%20Sie%20ein%20Tab-Feld%20mit%20einem%20Kreuz-Tab-Box-Design%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42216%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ENur%20eine%20Sache%3A%20In%20Ihrer%20Funktion%20musste%20ich%20die%20Zeile%20%C3%A4ndern%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2F%20Add%20the%20BorderBox%20to%20the%20LineupBox%0A%20%20Insert%20Into(%20lb%2C%20b%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ehinein%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%2F%2F%20Add%20the%20BorderBox%20to%20the%20LineupBox%0A%20%20lb%20%26lt%3B%26lt%3B%20Append(%20b%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Edamit%20es%20funktioniert%2C%20sonst%20bekomme%20ich%20nichts%20angezeigt.%3CBR%20%2F%3E%3CBR%20%2F%3E%20Ich%20liebe%20deine%20Arbeit%20auf%20jeden%20Fall!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-42214%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Erstellen%20Sie%20ein%20Tab-Feld%20mit%20einem%20Kreuz-Tab-Box-Design%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42214%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESehr%20sch%C3%B6n!%20Danke%20sch%C3%B6n!%20Ich%20werde%20diese%20Codevorlage%20sicherlich%20oft%20verwenden!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-42150%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Erstellen%20Sie%20ein%20Tab-Feld%20mit%20einem%20Kreuz-Tab-Box-Design%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-42150%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESie%20k%C3%B6nnen%20das%20Tabulate%20mithilfe%20einer%20TableBox%20und%20ColSpan-Boxen%20relativ%20einfach%20neu%20erstellen.%20Ein%20Beispiel%20finden%20Sie%20weiter%20unten.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0ANew%20Window(%20%22Col%20Span%20Box%22%2C%0A%20Table%20Box(%0A%20%20Number%20Col%20Box(%20%22CAT_ECH%22%2C%20%7B1%2C%202%2C%203%7D%20)%2C%0A%20%20Col%20Span%20Box(%0A%20%20%20%22CAT_MK%22%2C%0A%20%20%20Col%20Span%20Box(%0A%20%20%20%20%220-100%22%2C%0A%20%20%20%20Col%20Span%20Box(%22COUT_TOT_ENVIRONNE%22%2CNumber%20Col%20Box(%20%22Mean%22%2C%20%7B1%2C%202%2C%203%7D%20))%2C%0A%20%20%20%20Col%20Span%20Box(%22TEMPS%22%2CNumber%20Col%20Box(%20%22Mean%22%2C%20%7B1%2C%202%2C%203%7D%20))%2C%0A%20%20%20%20Col%20Span%20Box(%22COUT_CONSOS%22%2CNumber%20Col%20Box(%20%22Mean%22%2C%20%7B1%2C%202%2C%203%7D%20))%0A%20%20%20)%2C%0A%20%20%20Col%20Span%20Box(%0A%20%20%20%20%22%26gt%3B%3D100%22%2C%0A%20%20%20%20Col%20Span%20Box(%22COUT_TOT_ENVIRONNE%22%2CNumber%20Col%20Box(%20%22Mean%22%2C%20%7B1%2C%202%2C%203%7D%20))%2C%0A%20%20%20%20Col%20Span%20Box(%22TEMPS%22%2CNumber%20Col%20Box(%20%22Mean%22%2C%20%7B1%2C%202%2C%203%7D%20))%2C%0A%20%20%20%20Col%20Span%20Box(%22COUT_CONSOS%22%2CNumber%20Col%20Box(%20%22Mean%22%2C%20%7B1%2C%202%2C%203%7D%20))%0A%20%20%20)%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ESo%20sieht%20die%20Col%20Span%20Box-Methode%20aus%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Col%20Span%20Box.PNG%22%20style%3D%22width%3A%20855px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Col%20Span%20Box.PNG%22%20style%3D%22width%3A%20855px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Col%20Span%20Box.PNG%22%20style%3D%22width%3A%20855px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F6845iB69DA6AC87910B46%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Col%20Span%20Box.PNG%22%20alt%3D%22Col%20Span%20Box.PNG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EDa%20die%20CrossTabBox%20DisplayBox%20nicht%20mit%20JSL%20skriptf%C3%A4hig%20ist%2C%20m%C3%BCssten%20Sie%20eine%20andere%20Methode%20verwenden%2C%20um%20etwas%20wie%20das%20nachzubilden%2C%20was%20in%20der%20Contingency-Plattform%20verwendet%20wird.%3C%2FP%3E%0A%3CP%3ESie%20k%C3%B6nnen%20dies%20mithilfe%20eines%20Konzepts%20tun%2C%20an%20dem%20ich%20gearbeitet%20habe%2C%20um%20mithilfe%20einer%20LineupBox%20Ihre%20eigenen%20benutzerdefinierten%20Tabellen%20zu%20erstellen.%20Diese%20Methode%20verwendet%20eine%20benutzerdefinierte%20Funktion%20f%C3%BCr%20die%20Erstellung%20jeder%20Zelle%2C%20um%20eine%20gro%C3%9Fe%20Codeduplizierung%20zu%20vermeiden.%20Einzelheiten%20finden%20Sie%20in%20meinen%20Kommentaren.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%0A%2F%2Fhelper%20function%20to%20create%20cells%20in%20the%20lineupBOx%20%22table%22%0AgetCell%20%3D%20Function(%20%7Bvalues%2C%20altShading%2C%20justify%20%3D%20%22left%22%7D%2C%0A%20%7BDefault%20Local%7D%2C%20%0A%20%0A%20%2F%2F%20Create%20a%20lineup%20box%20to%20add%20each%20of%20the%20values%20to%0A%20lb%20%3D%20Lineup%20Box(%20N%20Col(%201%20)%2C%20SPacing(%200%20)%20)%3B%20%2F%2F%201%20column%20and%20no%20spacing%0A%20%0A%20%2F%2F%20loop%20through%20and%20add%20each%20value%0A%20For(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20values%20)%2C%20i%2B%2B%2C%20%0A%20%0A%20%20%2F%2F%20if%20justify%20is%20left%2C%20put%20the%20spacer%20box%20on%20the%20right%2C%20otherwise%2C%20put%20it%20on%20the%20left%0A%20%20If(%20justify%20%3D%3D%20%22left%22%2C%20%0A%20%20%20%2F%2F%20borderBox%20to%20give%20values%20some%20spacing%20(and%20for%20shading)%0A%20%20%20b%20%3D%20Border%20Box(%20Right(%205%20)%2C%20Left(%205%20)%2C%20top(%201%20)%2C%20bottom(%201%20)%2C%0A%20%20%20%20H%20List%20Box(%0A%20%20%20%20%20%2F%2FText%20box%20with%20current%20value%0A%20%20%20%20%20Text%20Box(%20values%5Bi%5D%20)%2C%0A%20%20%20%20%20%2F%2F%20Spacing%20to%20fill%20the%20cell%20shading%20all%20the%20way%20to%20the%20right%20(will%20grow%20horizontally%2C%20but%20not%20vertially)%0A%20%20%20%20%20Spacer%20Box(%20%26lt%3B%3CSET%20max%3D%22%22%20size%3D%22%22%3E%3D100%22%2C%20%22%22%2C%20%22%22%2C%20%22%22%7D%2C%200%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%22Total%22%2C%20%22%22%2C%20%22%22%2C%20%22%22%7D%2C%200%20)%2C%20%0A%20%20%20%20%20%0A%20%20%20%20%20%20%2F%2FRow%202%0A%20%20%20%20%20%20getCell(%20%7B%220-250%22%2C%20%22%22%2C%20%22%22%2C%20%22%22%7D%2C%200%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%20%0A%20%20%20%20%20%0A%20%20%20%20%20%20%2F%2FRow%203%0A%20%20%20%20%20%20getCell(%20%7B%22250-3000%22%2C%20%22%22%2C%20%22%22%2C%20%22%22%7D%2C%200%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%20%0A%20%20%20%20%20%0A%20%20%20%20%20%20%2F%2FRow%204%0A%20%20%20%20%20%20getCell(%20%7B%22%26gt%3B%3D3000%22%2C%20%22%22%2C%20%22%22%2C%20%22%22%7D%2C%200%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%2C%20%2243.33%22%2C%20%2268.42%22%7D%2C%201%2C%20%22Right%22%20)%2C%20%0A%20%20%20%20%20%0A%20%20%20%20%20%20%2F%2FRow%205%0A%20%20%20%20%20%20getCell(%20%7B%22Total%22%2C%20%22%22%7D%2C%200%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%7D%2C%201%2C%20%22Right%22%20)%2C%0A%20%20%20%20%20%20getCell(%20%7B%2213%22%2C%20%2230.95%22%7D%2C%201%2C%20%22Right%22%20)%0A%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20)%0A%20%20)%0A%20)%0A)%3B%3C%2FSET%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ESo%20sieht%20das%20resultierende%20Fenster%20mit%20dieser%20Methode%20aus%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Custom%20Table.PNG%22%20style%3D%22width%3A%20289px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Custom%20Table.PNG%22%20style%3D%22width%3A%20289px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Custom%20Table.PNG%22%20style%3D%22width%3A%20289px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F6846i8D501EA20DA0A46D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Custom%20Table.PNG%22%20alt%3D%22Custom%20Table.PNG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
heloiseheraud
Level II

Create a tab box with a cross tab box design

Hi all,

 

Not sure this is possible, but I try my luck.

 

I would like to create (in jsl) kind of a cross tab box, but customized with my own values. To make myself better understood:

Here is a tabulate (FIG. 1) containing the data I want to display:

 

FIG. 1 - TabulateFIG. 1 - Tabulate

 

 

This is fine, but not quite what I want. What I would like to obtain is something similar to the cross tab box we get when calling a contingency analysis, such as in FIG.2:FIG.2 - contingency tableFIG.2 - contingency table

BUT instead of "Count", "Total%" and so on, I would put into the cells the mean values that correspond to my analysis columns in tabulate.

 

The features I like in this design and which I don't have in the tabulate version are :

- the possibility to display several values in one cell (and display legend in the top left hand corner)

- the shade on columns AND rows headers

- the absence of the "mean" line under the column headers


I couldn't find a way of converting my tabulate into what I want using tab box. Do you think it would be possible?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Create a tab box with a cross tab box design

You can fairly easily recreate the Tabulate using a TableBox and ColSpan Boxes. See below for an example.

Names Default To Here( 1 );
New Window( "Col Span Box",
	Table Box(
		Number Col Box( "CAT_ECH", {1, 2, 3} ),
		Col Span Box(
			"CAT_MK",
			Col Span Box(
				"0-100",
				Col Span Box("COUT_TOT_ENVIRONNE",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("TEMPS",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("COUT_CONSOS",Number Col Box( "Mean", {1, 2, 3} ))
			),
			Col Span Box(
				">=100",
				Col Span Box("COUT_TOT_ENVIRONNE",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("TEMPS",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("COUT_CONSOS",Number Col Box( "Mean", {1, 2, 3} ))
			)
		)
	)
);

Here is what the Col Span Box method looks like:

Col Span Box.PNG

Since the CrossTabBox DisplayBox is not scriptable using JSL, you would need to use a different method to recreate something like what is used in the Contingency platform.

You can do this using a concept I have been working on to use a LineupBox to create your own custom tables. This method uses a custom function for the creation of each cell to avoid a lot of code duplication. See my comments for details.


//helper function to create cells in the lineupBOx "table"
getCell = Function( {values, altShading, justify = "left"},
	{Default Local}, 
	
	// Create a lineup box to add each of the values to
	lb = Lineup Box( N Col( 1 ), SPacing( 0 ) ); // 1 column and no spacing
	
	// loop through and add each value
	For( i = 1, i <= N Items( values ), i++, 
	
		// if justify is left, put the spacer box on the right, otherwise, put it on the left
		If( justify == "left", 
			// borderBox to give values some spacing (and for shading)
			b = Border Box( Right( 5 ), Left( 5 ), top( 1 ), bottom( 1 ),
				H List Box(
					//Text box with current value
					Text Box( values[i] ),
					// Spacing to fill the cell shading all the way to the right (will grow horizontally, but not vertially)
					Spacer Box( <<Set Max Size( 99999, 0 ) )
				)
			)
		,
			b = Border Box( Right( 5 ), Left( 5 ), top( 1 ), bottom( 1 ),
				H List Box(
					// Spacing to right align the text. the spacer will grow horizontally, but not vertially)
					Spacer Box( <<Set Max Size( 99999, 0 ) ),
					
					//Text box with current value
					Text Box( values[i] )
				)
			)
		);
		
		// if altShading is turned on
		If( altShading == 1,
		
			// check if this is an even numbered row
			If( Mod( i, 2 ) == 0,
				//set the background color to a light-gray
				b << Background color( RGB Color( 225, 225, 225 ) )
			),
			
			//when altShading is off, we set the background color to a light-gray for all values
			b << Background color( RGB Color( 225, 225, 225 ) )
		);
		
		// Add the BorderBox to the LineupBox
		Insert Into( lb, b );
	);
	
	// Return the LineupBox with a Border with lines around it
	Return(
		Border Box( Right( 0 ), Left( 0 ), top( 0 ), bottom( 0 ), sides( 15 ),
			lb
		)
	);
	
);

New Window( "Custom Table",
	Outline Box( "Custom Table",
		Border Box( Right( 5 ), Left( 5 ), top( 5 ), bottom( 5 ),
			H List Box(
				V Center Box( Text Box( "CAT_ECH", <<Rotate Text( "left" ) ) ),
				V List Box(
					H Center Box( Text Box( "CAT_MK" ) ),
					Lineup Box( N Col( 4 ), spacing( 0 ), 
						
						//Row 1
						getCell( {"Count", "Total %", "Col %", "Row %"}, 1 ),
						getCell( {"0-100", "", "", ""}, 0 ),
						getCell( {">=100", "", "", ""}, 0 ),
						getCell( {"Total", "", "", ""}, 0 ), 
					
						//Row 2
						getCell( {"0-250", "", "", ""}, 0 ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ), 
					
						//Row 3
						getCell( {"250-3000", "", "", ""}, 0 ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ), 
					
						//Row 4
						getCell( {">=3000", "", "", ""}, 0 ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ), 
					
						//Row 5
						getCell( {"Total", ""}, 0 ),
						getCell( {"13", "30.95"}, 1, "Right" ),
						getCell( {"13", "30.95"}, 1, "Right" ),
						getCell( {"13", "30.95"}, 1, "Right" )
					)
				)
			)
		)
	)
);

Here is what the resulting window will look like with this method:

Custom Table.PNG

Justin

View solution in original post

4 REPLIES 4

Re: Create a tab box with a cross tab box design

You can fairly easily recreate the Tabulate using a TableBox and ColSpan Boxes. See below for an example.

Names Default To Here( 1 );
New Window( "Col Span Box",
	Table Box(
		Number Col Box( "CAT_ECH", {1, 2, 3} ),
		Col Span Box(
			"CAT_MK",
			Col Span Box(
				"0-100",
				Col Span Box("COUT_TOT_ENVIRONNE",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("TEMPS",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("COUT_CONSOS",Number Col Box( "Mean", {1, 2, 3} ))
			),
			Col Span Box(
				">=100",
				Col Span Box("COUT_TOT_ENVIRONNE",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("TEMPS",Number Col Box( "Mean", {1, 2, 3} )),
				Col Span Box("COUT_CONSOS",Number Col Box( "Mean", {1, 2, 3} ))
			)
		)
	)
);

Here is what the Col Span Box method looks like:

Col Span Box.PNG

Since the CrossTabBox DisplayBox is not scriptable using JSL, you would need to use a different method to recreate something like what is used in the Contingency platform.

You can do this using a concept I have been working on to use a LineupBox to create your own custom tables. This method uses a custom function for the creation of each cell to avoid a lot of code duplication. See my comments for details.


//helper function to create cells in the lineupBOx "table"
getCell = Function( {values, altShading, justify = "left"},
	{Default Local}, 
	
	// Create a lineup box to add each of the values to
	lb = Lineup Box( N Col( 1 ), SPacing( 0 ) ); // 1 column and no spacing
	
	// loop through and add each value
	For( i = 1, i <= N Items( values ), i++, 
	
		// if justify is left, put the spacer box on the right, otherwise, put it on the left
		If( justify == "left", 
			// borderBox to give values some spacing (and for shading)
			b = Border Box( Right( 5 ), Left( 5 ), top( 1 ), bottom( 1 ),
				H List Box(
					//Text box with current value
					Text Box( values[i] ),
					// Spacing to fill the cell shading all the way to the right (will grow horizontally, but not vertially)
					Spacer Box( <<Set Max Size( 99999, 0 ) )
				)
			)
		,
			b = Border Box( Right( 5 ), Left( 5 ), top( 1 ), bottom( 1 ),
				H List Box(
					// Spacing to right align the text. the spacer will grow horizontally, but not vertially)
					Spacer Box( <<Set Max Size( 99999, 0 ) ),
					
					//Text box with current value
					Text Box( values[i] )
				)
			)
		);
		
		// if altShading is turned on
		If( altShading == 1,
		
			// check if this is an even numbered row
			If( Mod( i, 2 ) == 0,
				//set the background color to a light-gray
				b << Background color( RGB Color( 225, 225, 225 ) )
			),
			
			//when altShading is off, we set the background color to a light-gray for all values
			b << Background color( RGB Color( 225, 225, 225 ) )
		);
		
		// Add the BorderBox to the LineupBox
		Insert Into( lb, b );
	);
	
	// Return the LineupBox with a Border with lines around it
	Return(
		Border Box( Right( 0 ), Left( 0 ), top( 0 ), bottom( 0 ), sides( 15 ),
			lb
		)
	);
	
);

New Window( "Custom Table",
	Outline Box( "Custom Table",
		Border Box( Right( 5 ), Left( 5 ), top( 5 ), bottom( 5 ),
			H List Box(
				V Center Box( Text Box( "CAT_ECH", <<Rotate Text( "left" ) ) ),
				V List Box(
					H Center Box( Text Box( "CAT_MK" ) ),
					Lineup Box( N Col( 4 ), spacing( 0 ), 
						
						//Row 1
						getCell( {"Count", "Total %", "Col %", "Row %"}, 1 ),
						getCell( {"0-100", "", "", ""}, 0 ),
						getCell( {">=100", "", "", ""}, 0 ),
						getCell( {"Total", "", "", ""}, 0 ), 
					
						//Row 2
						getCell( {"0-250", "", "", ""}, 0 ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ), 
					
						//Row 3
						getCell( {"250-3000", "", "", ""}, 0 ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ), 
					
						//Row 4
						getCell( {">=3000", "", "", ""}, 0 ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ),
						getCell( {"13", "30.95", "43.33", "68.42"}, 1, "Right" ), 
					
						//Row 5
						getCell( {"Total", ""}, 0 ),
						getCell( {"13", "30.95"}, 1, "Right" ),
						getCell( {"13", "30.95"}, 1, "Right" ),
						getCell( {"13", "30.95"}, 1, "Right" )
					)
				)
			)
		)
	)
);

Here is what the resulting window will look like with this method:

Custom Table.PNG

Justin
heloiseheraud
Level II

Re: Create a tab box with a cross tab box design

Very nice! Thank you! I surely will use this code template a lot!!

heloiseheraud
Level II

Re: Create a tab box with a cross tab box design

Just one thing though, in your function I had to change the line:

 

// Add the BorderBox to the LineupBox
		Insert Into( lb, b );

into:

 

// Add the BorderBox to the LineupBox
		lb << Append( b );

 to make it work, otherwise I got nothing displayed.

I definitely love your work!

Re: Create a tab box with a cross tab box design

Ah, yes. The Insert Into functionality for DisplayBoxes was not added until JMP 13. Glad to hear this will work for you.

Justin

Recommended Articles