Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys,
I have a problem like this :
load * inline [
id description
10 hello1
10 hello1
10 hello1
10 hello1
20 hello1
];
And I want to calculate how many times has the id number repeated. Somethink like :
ID counter
10 4
20 1
Anybody knows how can I do that?
Many thanks in advance.
Hi Marcel,
Try this code :
TestTable:
LOAD * INLINE [
ID, Description
10, hello1
10, hello1
10, hello1
10, hello1
20, hello2
];
Load *,
count(ID)as Counter
resident TestTable group by ID,Description;
....Regards,
tresesco
Hi,
You can create a straight table to display the result...
use expression
Count (Description)
Check the attached example....
Thanks and Regards!!!
Thank you nilupaboralessa for your answer.
I've seen your script. I know it's easy to do it when the document is loaded, but I need to do it when the document is not loaded yet.
I need to know how many times each id appears in the script, to do a Loop for another table.
Many thanks in advance
HI Marcel,
Without loading the document how can you use the data..
After loading the Document only you can work upon it..
Regards
Sunil
Well, what I really need to do is an scheme accounts loading document, and I need to do two nested for bucles to check the ranks of the accounts document. The second bucle is for how many times the number of an account appears in the table.
Are you telling me this is impossible? Even loading resident tables?
Thanks a million.
Regards
Well, what I really need to do is an scheme accounts loading document, and I need to do two nested for bucles to check the ranks of the accounts document. The second bucle is for how many times the number of an account appears in the table.
Are you telling me this is impossible? Even loading resident tables?
Thanks a million.
Regards
TRy the count() function
Thanks Steve for your reply,
it was the first thing I did, count( id ) and even count(distinct id), and it didn't work.
Thanks anyway!
Hi Marcel,
Try this code :
TestTable:
LOAD * INLINE [
ID, Description
10, hello1
10, hello1
10, hello1
10, hello1
20, hello2
];
Load *,
count(ID)as Counter
resident TestTable group by ID,Description;
....Regards,
tresesco
HI Marcel,
You can do this using resident load but you need to write the funstion like FieldValueCount with if condition.
It is present in Function Category (inter record) in the edit Script..
Try for other functions also ..
Hope it will help you
Regards,
Sunil