Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
QSMACHBI
Contributor III
Contributor III

Sum of Duration (hh:mm:ss) / Nprinting (June 2019)

Issue with Sum Duration in Nprinting (Report type : Pixcel Perfect)

I have a field of working duration in Qlik Sense Application.

I was able to show the duration per shift when I formatted my duration in Text (Ex. Working hours : 11:14:00) in the application.

 

Now I have my duration in text for group details, and I want to apply a Sum of duration for each employee !

Sum(11:14:00 + 00:01:00 +00:15:00) = 12:00:00      (12 hours)

My problem : how I can convert Text(hh:mm:ss) to Numeric value Num(hh:mm:ss)  and sum all duration in footer report in order to show the Sum with hh:mm:ss format !

 

Labels (2)
5 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Interesting question and so far i was not able to find satisfying me solution. I found few workarounds where i would calculate group total as a different object in Qlik but was not able to use Summary ->Group ->Sum and format result as duration.

 

My scenario:

- using QlikView

- Created a field called "Duration"which has values between 0 -1 and used it in expression Sum(Duration). this field can be considered as a time/duration.

- Created a table in QlikView with Dim1 and Dim 2 as dimensions and Sum(Duration) as expression

- Brought in the above table as level to PixelPerfect template

- I built detailed report of this level and in Detail band added all fields

- i am able to format those fields in NPrinting pixel perfect to any number/percentage format and I am also able to create group footer or header with sum(Duration) column used as data member and apply summary --> Group --> Sum function to calculate total

- if i try to apply time duration formatting on it neither format work nor summation in total.

I believe this is the way DevExpress library is designed to deal with data as it expects Time-Span for duration formatting --> https://www.devexpress.com/Support/Center/Question/Details/T583334/time-format-xtrareport where from Qlik it receives number.

@Ruggero_Piccoli - what would be your recommendation?

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Ruggero_Piccoli
Support
Support

Hi,

Could you send me your example? I would like to investigate.

I suppose the only way could be to write a script to calculate and format a custom total. 

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
QSMACHBI
Contributor III
Contributor III
Author

I created a measure in Qlik Sense which represent a Sum(Duration) as number (decimal),

Now I want to have example, how to format this decimal number as duration in a script (I suppose with C#) !, for this Pixcel Perfect report.

Assumed that I have 3 durations with their decimal values. I made a sum of these values in a footer ===> Ok

But I want to format this Sum (convert decimal to duration)  in a footer of this group !

Ex : Sum(NumericDuration) = 0,84375 ===> Format as hh:mm:ss :[20:15:00

How I can reference this object in a C# Script, for what event (befor print ! or other event !)

My granular value in a detail section is named : label28

And My sum in a footer section, is named label29

 

I don't know how to reference them in this environnement (C# of Pixcel Perfect 3 Report Designer) !!!

It is another environment (C#  Report Designer)  which I ignore how it works !!!

😞

 

QSMACHBI
Contributor III
Contributor III
Author

PrintScreen (Example)

Ruggero_Piccoli
Support
Support

Hi,

@QSMACHBI @Lech_Miszkiewicz give a check at this new article https://community.qlik.com/t5/Qlik-NPrinting-Documents/Summarize-Time-Columns-in-PixelPerfect-Report...

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.