cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-384699%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EVerbinden%20Sie%20Daten%20basierend%20auf%20dem%20ungef%C3%A4hren%20Zeitstempel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-384699%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EIch%20habe%20zwei%20Datentabellen%2C%20die%20ich%20verbinden%20muss.Tabelle%20A%20enth%C3%A4lt%20Zeitstempel%20in%20Stunden%3A%2024%2C%2048%2C%2072%2C%2096%2C%20....Tabelle%20B%20enth%C3%A4lt%20Online-Daten%20mit%205-Minuten-Intervallen%2C%20daher%20muss%20der%20Zeitstempel%20mehrere%20Dezimalstellen%20haben%2C%20um%20die%20Genauigkeit%20zu%20erfassen%3A%201.000%2C%201.083%2C%201.167%2C%201.250%2C%201.333%2C%201.417%2C%201.500%20usw.%20Das%20Verbinden%20von%20B%20mit%20A%20funktioniert%20gut.%20Dies%20ist%20kein%20Problem%2C%20da%20es%20immer%20eine%20ganzzahlige%20%C3%9Cbereinstimmung%20des%20Zeitstempels%20in%20Tabelle%20B%20mit%20Tabelle%20A%20gibt.%20Daher%20gibt%20es%20f%C3%BCr%20alle%20Zeitpunkte%20von%20A%20einen%20entsprechenden%20Wert%20in%20B.%20Das%20Problem%20besteht%20darin%2C%20dass%20Tabelle%20A%20bei%20manchen%20Zeiten%20mit%20%E2%80%9E120%2C1%E2%80%9C%20endet.%20oder%20zum%20Beispiel%20%E2%80%9E120%2C4%E2%80%9C%20Stunden.%20Dies%20bedeutet%2C%20dass%20die%20Verkn%C3%BCpfung%20fehlschl%C3%A4gt%20und%20am%20endg%C3%BCltigen%20Datenpunkt%20keine%20Daten%20von%20B%20mit%20A%20verkn%C3%BCpft%20werden.%20Gibt%20es%20eine%20M%C3%B6glichkeit%2C%20%E2%80%9Eungef%C3%A4hre%E2%80%9C%20%C3%9Cbereinstimmungen%20zu%20erhalten%2C%20so%20wie%20VLOOKUP%20in%20Excel%20funktioniert%3F%20Ich%20kann%20die%20Werte%20von%20Tabelle%20B%20nicht%20einfach%20runden%2C%20da%20ich%20dann%20wiederkehrende%20Werte%20habe%20(in%20den%20Intervallen%200%2C3%20und%200%2C8).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-384699%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EDatenmischung%20und%20-bereinigung%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-384743%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Daten%20basierend%20auf%20dem%20ungef%C3%A4hren%20Zeitstempel%20zusammenf%C3%BChren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-384743%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEine%20weitere%20Idee%2C%20die%20Sie%20m%C3%B6glicherweise%20pr%C3%BCfen%20m%C3%B6chten%2C%20ist%20die%20Verwendung%20von%20JMP%20Query%20Builder%20zur%20Durchf%C3%BChrung%20von%20%E2%80%9EFuzzy%E2%80%9C-Joins.%3C%2FP%3E%0A%3CP%3EIch%20habe%20mir%20das%20f%C3%BCr%20jemanden%20angesehen%2C%20der%20mithilfe%20der%20Massenspektrometrie%20chemische%20Komponenten%20identifizieren%20wollte%2C%20die%20innerhalb%20eines%20bestimmten%20Massenbereichs%20liegen.%3C%2FP%3E%0A%3CP%3EAls%20Beispiel%20habe%20ich%203%20Tabellen%20angeh%C3%A4ngt.%20Die%20verbundene%20Tabelle%20hat%20eine%20Klasse%20aus%20der%20Ref-Tabelle%2C%20wobei%20die%20Masse%20in%20der%20Datentabelle%20im%20Bereich%20von%20%E2%80%9EMass%20Low%E2%80%9C%20und%20%E2%80%9EMass%20High%E2%80%9C%20liegt.%3C%2FP%3E%0A%3CP%3EGerne%20gebe%20ich%20Ihnen%20weitere%20Hinweise%2C%20wenn%20Sie%20der%20Meinung%20sind%2C%20dass%20diese%20L%C3%B6sung%20n%C3%BCtzlich%20w%C3%A4re.%3C%2FP%3E%0A%3CP%3ESo%20wird%20der%20Fuzzy-Join%20im%20JMP%20Query%20Builder%20definiert%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-05-13%20121130.png%22%20style%3D%22width%3A%20765px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202021-05-13%20121130.png%22%20style%3D%22width%3A%20765px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202021-05-13%20121130.png%22%20style%3D%22width%3A%20765px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F32810i82EF64C99C04F884%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-05-13%20121130.png%22%20alt%3D%22Screenshot%202021-05-13%20121130.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-384710%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Daten%20basierend%20auf%20dem%20ungef%C3%A4hren%20Zeitstempel%20zusammenf%C3%BChren%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-384710%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHALLO%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESchauen%20Sie%20sich%20die%20Funktion%20Loc%20Sorted(%20)%20an.%20Es%20kann%20zum%20Durchf%C3%BChren%20von%20Suchvorg%C3%A4ngen%20verwendet%20werden.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDer%20folgende%20Code%20weist%20beispielsweise%20simulierten%20Testergebnissen%20Buchstabennoten%20zu.%20Das%20hei%C3%9Ft%2C%20unter%20Verwendung%20einer%20Nachschlagematrix%20%5B0%2C%2060%2C%2070%2C%2080%2C%2090%5D%20werden%20Stichprobenergebnissen%20von%2085%2C%2067%2C%2099%2C%2092%20und%2089%20die%20Buchstabennoten%20F%2C%20D%2C%20C%2C%20B%20und%20A%20zugewiesen%2C%20je%20nachdem%2C%20ob%20das%20Ergebnis%200%20%C3%BCbersteigt%20%2C%2060%2C%2070%2C%2080%20bzw.%2090.%20Ich%20habe%20es%20auf%20%C3%A4hnliche%20Weise%20wie%20Ihren%20Anwendungsfall%20verwendet.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EProst%2C%3C%2FP%3E%0A%3CP%3EBrady%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EWords(%20%22FDCBA%22%2C%20%22%22%20)%5BLoc%20Sorted(%20%5B0%2C%2060%2C%2070%2C%2080%2C%2090%5D%2C%20%5B85%2C%2067%2C%2099%2C%2092%2C%2089%5D%20)%5D%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22brady_brady_0-1620871449883.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22brady_brady_0-1620871449883.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22brady_brady_0-1620871449883.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F32807iD7DB04C360820AED%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22brady_brady_0-1620871449883.png%22%20alt%3D%22brady_brady_0-1620871449883.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
tatersalad
Level II

join data based on approximate time stamp

I have two data tables that i need to join.  table A has time stamps in hours: 24, 48, 72, 96,....  table B has online data with 5 minute intervals, so the time stamp must have several decimal places to capture the precision: 1.000, 1.083, 1.167, 1.250, 1.333, 1.417, 1.500 etc.  joining B to A works well. these is no problems because there is always a whole number match of time stamp in table B with table A. so for all of A's time points there is a corresponding value in B. the problem is that some times table A ends in "120.1" or "120.4" hours for example. This means that the join fails and no data from B will join to A at the final data point. is there a way to get "approximate" matches like the way VLOOKUP works in excel? I cannot simple round the values of table B because then i have repeating values (at the 0.3 and 0.8 intervals)

 

2 REPLIES 2

Re: join data based on approximate time stamp

HI,

 

Check out the Loc Sorted( ) function. It can be used to perform lookups.

 

For example, the code below assigns letter grades to simulated test scores. That is, using a lookup matrix [0, 60, 70, 80, 90], sample scores of 85, 67, 99, 92 and 89 are assigned letter grades F, D, C, B and A depending if the score exceeds 0, 60, 70, 80 or 90, respectively. I've used it in ways analogous to your use case.

 

Cheers,

Brady

 

Words( "FDCBA", "" )[Loc Sorted( [0, 60, 70, 80, 90], [85, 67, 99, 92, 89] )];

brady_brady_0-1620871449883.png

 

Phil_Kay
Staff

Re: join data based on approximate time stamp

Another idea that you might wish to check is using JMP Query Builder to do "fuzzy" joins.

I looked at this for someone that wanted to identify chemical components that are within a certain range of mass from mass spectrometry.

I have attached 3 tables as an example. The Joined table has class from the Ref table where Mass in the Data table is within the range of Mass Low and Mass High.

I am happy to provide more guidance if you think this solution would be useful.

This is how the fuzzy join is defined in JMP Query Builder:

Screenshot 2021-05-13 121130.png

Recommended Articles