Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
PseudoCode:
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?
Thanks
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
Thanks for the clarification, Marcus.
Is this question related to https://community.qlik.com/t5/QlikView-App-Dev/Calculate-all-row-values/td-p/1890740 ?
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.