printing numbers with notappl

Discussions about editing and cleaning data
Post Reply
AriSilva
Posts: 618
Joined: July 22nd, 2016, 3:55 pm

printing numbers with notappl

Post by AriSilva »

Up to version 7.1 or 7.2, I do no t remember, when you had a maketext with a variable whose value was notappl it was shown as "", that is, a blank value.
That was very handy because if you did not want to "polute" your output with zeros, it was just a matter of changing the variable from zero to notappl.
But now the variables with a notappl value are shown as "NOTAPPL".
You can see the difference by looking at these two files I´ve attached.

The question is: with this new version, is there a way to show a null string (or a blank) when the value is notappl?
Attachments
TCA_61_SETOR_RESUMO_20190926.csv
(32.01 KiB) Downloaded 300 times
TCA_61_SETOR_RESUMO_20190904.csv
(25.21 KiB) Downloaded 340 times
Best
Ari
josh
Posts: 2401
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: printing numbers with notappl

Post by josh »

How about a function like this:

function string notapplToBlank(numeric n)
if n = notappl then
notapplToBlank = "";
else
notapplToBlank = maketext("%d", n);
end;
AriSilva
Posts: 618
Joined: July 22nd, 2016, 3:55 pm

Re: printing numbers with notappl

Post by AriSilva »

That´s what I´m doing write now, but it has to be done in a 1 by 1 basis, which is a pain in ...
Best
Ari
Post Reply