Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can i sum in Qlik field by sections
Now i use
RangeSum(Above(TOTAL Sum({<CHILD_ACTION_FLAG = {2}>} NEW_DIFF_HH_NUMBER2 ),1,RowNo(TOTAL)))
NEW_DIFF_HH_NUMBER2 is Time Deff
Is there an option to reset the RangeSum back to 00:00:00 every time the CHILD_ACTION_FLAG is not equal 2 ?
Hi Gilad,
I haven't found a front-end solution yet, but you can use this in the script:
Final:
Load
*,
IF( RowNo() = 1
, 0
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) <> 2
, 0
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) = 2
, NEW_DIFF_HH_NUMBER2 + Peek( _cntField)
, IF( CHILD_ACTION_FLAG <> 2
, 0
, 999
)
)
)
)
as _cntField
Resident Table
Order by COLLECTION_ID, SECOND_CATEGORY, DATE_SORT asc, CHILD_ACTION_FLAG asc
;
You need a resident load if you want to order the data correctly. So name your table Table (or something else) and execute this script.
Jordy
Climber
Hi Jordy
Thanks the solution works great,
I only made one change to get started from the first line,
I replaced the zero with - NEW_DIFF_HH_NUMBER2
Final:
Load
*,
IF( RowNo() = 1
, 0
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) <> 2
, NEW_DIFF_HH_NUMBER2//I replaced the zero
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) = 2
, NEW_DIFF_HH_NUMBER2 + Peek( _cntField)
, IF( CHILD_ACTION_FLAG <> 2
, 0
, 999
)
)
)
)
as _cntField
Resident Table
Order by COLLECTION_ID, SECOND_CATEGORY, DATE_SORT asc, CHILD_ACTION_FLAG asc
;
Thank you very much for your help.
Hey Gilad,
Van you share the application? This would make solving this easier.
Jordy
Climber
Hey Jordy
The application file is attached.
the application is still in the experimental stage, hope this is clear enough.
Thenks,
Gilad.
Hi Gilad,
I haven't found a front-end solution yet, but you can use this in the script:
Final:
Load
*,
IF( RowNo() = 1
, 0
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) <> 2
, 0
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) = 2
, NEW_DIFF_HH_NUMBER2 + Peek( _cntField)
, IF( CHILD_ACTION_FLAG <> 2
, 0
, 999
)
)
)
)
as _cntField
Resident Table
Order by COLLECTION_ID, SECOND_CATEGORY, DATE_SORT asc, CHILD_ACTION_FLAG asc
;
You need a resident load if you want to order the data correctly. So name your table Table (or something else) and execute this script.
Jordy
Climber
Hi Jordy
Thanks the solution works great,
I only made one change to get started from the first line,
I replaced the zero with - NEW_DIFF_HH_NUMBER2
Final:
Load
*,
IF( RowNo() = 1
, 0
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) <> 2
, NEW_DIFF_HH_NUMBER2//I replaced the zero
, IF( CHILD_ACTION_FLAG = 2 and Previous( CHILD_ACTION_FLAG ) = 2
, NEW_DIFF_HH_NUMBER2 + Peek( _cntField)
, IF( CHILD_ACTION_FLAG <> 2
, 0
, 999
)
)
)
)
as _cntField
Resident Table
Order by COLLECTION_ID, SECOND_CATEGORY, DATE_SORT asc, CHILD_ACTION_FLAG asc
;
Thank you very much for your help.