4 Replies Latest reply: Apr 13, 2017 11:37 AM by omar bensalem

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

• ###### Re: Question about cummulation

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

• ###### Re: Question about cummulation

(yes I inserted the missing t)

• ###### Re: Question about cummulation

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! ^^

• ###### Re: Question about cummulation

Can you share a sample app?