DTLfetch not working with Variable











up vote
0
down vote

favorite












I have csv database loaded in data variable.
I am trying to fetch value from particular column given an another column name and its value.
I am using following code



forloop{i}{1}{value{i} < 30}
{
DTLfetch{data}{Number}{value{i}}{Day}
}


Above code works well when there is hard coded numerical value like 1,2,3,... but somehow it is not able to catch the value of argument value{i}. What am I not doing right?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have csv database loaded in data variable.
    I am trying to fetch value from particular column given an another column name and its value.
    I am using following code



    forloop{i}{1}{value{i} < 30}
    {
    DTLfetch{data}{Number}{value{i}}{Day}
    }


    Above code works well when there is hard coded numerical value like 1,2,3,... but somehow it is not able to catch the value of argument value{i}. What am I not doing right?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have csv database loaded in data variable.
      I am trying to fetch value from particular column given an another column name and its value.
      I am using following code



      forloop{i}{1}{value{i} < 30}
      {
      DTLfetch{data}{Number}{value{i}}{Day}
      }


      Above code works well when there is hard coded numerical value like 1,2,3,... but somehow it is not able to catch the value of argument value{i}. What am I not doing right?










      share|improve this question













      I have csv database loaded in data variable.
      I am trying to fetch value from particular column given an another column name and its value.
      I am using following code



      forloop{i}{1}{value{i} < 30}
      {
      DTLfetch{data}{Number}{value{i}}{Day}
      }


      Above code works well when there is hard coded numerical value like 1,2,3,... but somehow it is not able to catch the value of argument value{i}. What am I not doing right?







      pdftex datatool for-loop






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 14 at 12:06









      charles bell

      607




      607






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The macro value gives the value of the counter as an internal integer.
          This is fine if you compare it with another integer as in {value{i} < 30},
          but for DTLfetch you need the representation of the number in arabic numerals,
          not just some internal integer.
          So you can use



          forloop{i}{1}{value{i} < 30}
          {
          DTLfetch{data}{Number}{arabic{i}}{Day}
          }





          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "85"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f455138%2fdtlfetch-not-working-with-variable%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            The macro value gives the value of the counter as an internal integer.
            This is fine if you compare it with another integer as in {value{i} < 30},
            but for DTLfetch you need the representation of the number in arabic numerals,
            not just some internal integer.
            So you can use



            forloop{i}{1}{value{i} < 30}
            {
            DTLfetch{data}{Number}{arabic{i}}{Day}
            }





            share|improve this answer

























              up vote
              0
              down vote













              The macro value gives the value of the counter as an internal integer.
              This is fine if you compare it with another integer as in {value{i} < 30},
              but for DTLfetch you need the representation of the number in arabic numerals,
              not just some internal integer.
              So you can use



              forloop{i}{1}{value{i} < 30}
              {
              DTLfetch{data}{Number}{arabic{i}}{Day}
              }





              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                The macro value gives the value of the counter as an internal integer.
                This is fine if you compare it with another integer as in {value{i} < 30},
                but for DTLfetch you need the representation of the number in arabic numerals,
                not just some internal integer.
                So you can use



                forloop{i}{1}{value{i} < 30}
                {
                DTLfetch{data}{Number}{arabic{i}}{Day}
                }





                share|improve this answer












                The macro value gives the value of the counter as an internal integer.
                This is fine if you compare it with another integer as in {value{i} < 30},
                but for DTLfetch you need the representation of the number in arabic numerals,
                not just some internal integer.
                So you can use



                forloop{i}{1}{value{i} < 30}
                {
                DTLfetch{data}{Number}{arabic{i}}{Day}
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 14 at 19:31









                Marcel Krüger

                11.2k11535




                11.2k11535






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f455138%2fdtlfetch-not-working-with-variable%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?