Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need to get the record count

Hi ,

I would like to the get the record count of processed rows, but each record will be processed one at a time. So while I try to get the count of record to some context variable, I am getting the count as 1 always. Would like to know how to get the total count.

 

Here in the tfileOutputExcel_1, I am getting the detailed information and tfileOutputExcel_2, will have summary details (same excel will have two tabs one is summary and one is detailed).

I would like to get the total record count from detailed excel to summary excel0683p000009LtZv.png

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Issue has been resolved after i used sequence in the column

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Hi
I want to know why only one record is processed at a time? and how do you get the record count? Can you upload the full screenshot of your job design?

Regards
Shong
mks02
Creator
Creator

Hi @sindhurak,

Find the attached mapping. Here I were creating excel file from csv file and then count the number of records in tJava ((Integer)globalMap.get("tFileOutputExcel_1_NB_LINE")).

You can find the list of variables in the "Outline" view on the bottom left of your screen.
Let me know  if it helps.


TLND_record_cnt.PNG
Anonymous
Not applicable
Author

Hi,

 

My excel has to read one record at a time because of some job specifications and iterating the excel to read further records. So that makes the problem when I try to count the records.


Sample.docx
Anonymous
Not applicable
Author

Hi

Even after using this, I am still getting total count as 1 because it is reading one row at a time. Any other way to resolve this ?

Anonymous
Not applicable
Author

Issue has been resolved after i used sequence in the column
hangel
Contributor
Contributor

Hi shong ,

I want to get the record count in separate new column and divide them in 2 different category as "Single" & "Multiple"

For Ex: If i have 1 unique serial No in my list then the new column should have name as Single . if the serial no. has multiple entry then the new column should hold only Multiple. Is this feasible?

Example


Anonymous
Not applicable
Author

@hangel, define a context variable for the value of new column, populate the count of serial No, and then assign corresponding value to context variable depend on the count number, for example:
....tAggregateRow--main--tJavaRow

tAggregateRow is used to the count of serial No,
on tJavaRow:
if(input_row.count>1){
context.newColumn="Multiple";
}else{
context.newColumn="Single ";
}

In next subjob, add a new column and set its value expression as: context.newColumn

Hope it helps you!

Regards
Shong
hangel
Contributor
Contributor

Thanks for your quick response @shong .

 

I have attached my existing job sample along with this chat thread. 

 

Do i need to add tAggregateRow after tXML Mapping in my job?

 

tSalesforceInput -> tXML Map -> tAggregateRow -> tJavarow-> tmap>tFileOutputRaw ->tHttpRequest?

 

Please suggest, Thanks Again.


sjob.JPG
Anonymous
Not applicable
Author

Where does serial No come from? Can you show a screenshot of tMap?