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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate subtotal

Hi everybody
I want to calculate subtotal of my input like that


0683p000009MHHB.jpg


I use tFileInputDelimited-----> tAggregateRow ------> tFileOutputExcel
I group by Country and i count with Date


Regards,

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi
There is a global variable defined on tFileInputDelimtied counts the total number of lines read from the source file, you can use this variable in the next subjob and append the record to an existing Excel file. eg:
tFileInputDelimited-----> tAggregateRow ------> tFileOutputExcel1
    |
onsubjobok

    |
tFixedFlowInput--main--tFileOutputExcel2


on tFixedFlowInput, define two columns: country and calls, and set their values to:
country: "Total"
calls: [font=Verdana, Helvetica, Arial, sans-serif] ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE"))[/font]
[font=Verdana, Helvetica, Arial, sans-serif] tFileOutputExcel2: check 'append existing file' and 'append existing sheet' box.[/font]


[font=Verdana, Helvetica, Arial, sans-serif] Regards[/font]
[font=Verdana, Helvetica, Arial, sans-serif] Shong[/font]