Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Question about cummulation

Data Base contains 3 values: Creation date, Closing date, Key.

I want to have the time on the X axis and the number of open operations on the Y axis.

According to my logic:

Open Operations = (Creation < Current X Value) - (Completed < Current X Value)

My experiments look like this:

Count ({1 <Creation <{$ <Now>}} Key)

What is the formula for this? In SQL no problem, but in Qlik Sense?


THX

4 Replies
OmarBenSalem

coun({<Date Creation=, Date Creation={"<= $(=Now()) "}>}Key)

Please refer to this thread to understand better the logic of set expressions with time:

YTD, MTD issue

Not applicable
Author

If I try this there are just no results at all.

(yes I inserted the missing t)

Not applicable
Author

I currently try this one, but it still not working:

count({$<Creation= {">=1(=Creation)"}>} Key)

My understanding of the expession is:

"$<Creation= " means the current value (thats why I inserted the "$") compare with

"{">=1(=Creation)"}>}" which should mean ALL values (thats why I put the "1" in it) which are lower or equal

and "Key" just to count something.

----

If I would write some code, it would look like this:

function giveMeEverythingOlderThanCurrentEntry (int $EntryValue)

{

int counter = 0;

for each $AllEntrys as $CompareWith

  {

    if $CompareWith.Creation <= $EntryValue

      counter ++;

  }

return counter;

}

then I would run the function for each row to get the needed values:

giveMeEverythingOlderThanCurrentEntry($currentRow.Creation)

I hope it is not confusing! ^^

OmarBenSalem

Can you share a sample app?