Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

Bug Tracker RSS feed

I’m currently working on a major new version of the datatool package. This may take a while. Please be patient. (Experimental version available for testing.)

ID 172🔗
Date: 2021-01-18 23:05:01
Status Open
Sign in if you want to bump this report.
Category datatool
Version 2.32
Summary \DTLminforcolumn does not work for empty fields

Sign in to subscribe to notifications about this report.

Description

See [TeX.SX Link] for an MWE as well as a possible fix.

Basically, applying \DTLminforcolumn to a column that contains empty fields will forget the minimum found so far and restart with the next value.

Not sure whether the behaviour of \DTLminforcolumn for empty fields should depend on \ifDTLlistskipempty; didn't read enough of the manual to fully understand its semantics.

MWE

Download (654B)

\documentclass{article}
\usepackage{filecontents}
\usepackage{datatool}

\begin{filecontents*}{example1.csv}
title;value
test1;1
test2;
test3;3
test4;2
\end{filecontents*}
\begin{filecontents*}{example2.csv}
title;value
test1;1
test2;2
test3;3
test4;4
\end{filecontents*}

\begin{document}
    \DTLsetseparator{;}%
    \DTLloaddb{a}{example1.csv}
    \DTLminforcolumn{a}{value}{\minValueFirstExample}
    
    \DTLsetseparator{;}%
    \DTLloaddb{b}{example2.csv}
    \DTLminforcolumn{b}{value}{\minValueSecondExample}
    
    Min Value1: \minValueFirstExample\\ %Should be 1 and not 2
    Min Value2: \minValueSecondExample %Is correct
\end{document}
  

Evaluation

Comments

0 comments.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=172