Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis question

Hello Guys,

I'm having problems with my pivot table. Let me evaluate:

A have a script that determines if a certain document no. is on time, 1-2 days late and if greater than 2 days it is considered delayed.

if(num(date2)-num(date1)<=0, 'Real Time', if(num(date2)-num(date1)>2,'Delayed', '1-2Days Late')) as Delays

I also created a script that counts the days delayed.

if(num(date2)-num(date1)<=0, '0', num(date2)-num(date1)) as DaysDelayed

So here comes the pivot table.

my expression for counting all the document no.

count(docno)

my expression for the days delayed

count({<Delays={"Real Time"}>}docno)

count({<Delays={"1-2Days"}>}docno)

count({<Delays={"Delayed"}>}docno)

so the output should be like this:

# of DocsReal Time1-2Days LateDelayed
100502030

When RealTime,1-2Days Late and Delayed are sum up, it should be equal to # of Docs.

But what is happening to my table,

# of Docs and Real Time is always equal. What could be causing this?

I tried filtering using the Delays field, # of Docs adjusted and no problem, but how come it doesn't

sum up? I tried creating it to a sample file, and it sums up, but when I am editing my main application,

It just happens.

I don't know if it somehow related to what I have done before it still computes equally. I included a history

of my previous data but the dates included in those are already way back 2010. What I'm currently

filtering is 2012 and still It doesn't work. Any help would be appreciated. Kindly tell me your findings.

Again, Thank you for taking time to read this.

Regards,

Donna

2 Replies
sivarajs
Specialist II
Specialist II

try to aggregate towards # of Docs

aggr(sum(Delays),# of Docs)

Not applicable
Author

thanks for answering. I have found the source, it looks like there are multiple records(dates) in 1 document no.

thank you sivaraj.