Skip to main content
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Loop Through Computation

Hi All,

I have the following feature to be implemented in QlikView. I want to know if this is possible or not. Please help.

I have a table containing the following data. I have to display a computed value in the textbox which will go through all the selected rows in the table and do the logical operation.




TTF = 0
For each row
     If (Fail = 0)
          TTF = TTF +(StopTS - StartTS)
     If (Fail = 1)
          TTF = TTF +(FailTS - StartTS)
          Break the loop if Fail = 1
Display TTF in Text Box



Please help me if this is something possible in QlikView and how.

What logic can be used?

Whether the logic can be implemented in the Textbox itself or should we use the Module?



Labels (4)
3 Replies

Real loop-calculations aren't possible within the UI. But quite often there are other ways to reach the same results. In your case it might be something like:

sum(aggr(if(Fail, Fail - Start, End - Start), Label, Fail))

In many scenarios it's preferable to transfer such logic at least partly within the script by flagging the cases and calculating there the duration and within the UI it's just enough to use a sum() or count() maybe with an optional  set analysis to get the wanted results.

- Marcus


Contributor II
Contributor II

Thanks for the clarification, Marcus.


Is this question related to ?

Your example shows a table sorted by Fail. As you only want to include the first occurrence of Fail=1, the result would depend on the interactive sort order of this table which does not impact the TextBox calculation per se.