Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vvira1316
Specialist II
Specialist II

How to get pivot table based on a condition on a set analysis calculation that is available in a straight table

Hi,

I've following straight table where Aging - Request Date is calculated as per Expression provided below. I need to create a Pivot table as seen in second screen shot, which I'm unable to formulate. Any guidance will be a big help.

NRAging.png

Calculations

Aging - Request Date

=Today() -
Max({<[Doc Status]={'New Request'}, [Is DF Document]={'No'},[Sub Doc Type]-={'VAL1', 'VAL2'},
[CP Doc: DocID]>}[Request Date])

Docs

=Count({<[Doc Status]={'New Request'}, [Is DF Document]={'No'},[Sub Document Type]-={'VAL1', 'VAL2'}>}[CP Doc: DocID])

Pivot Table Info

Will it be possible to create a pivot table of above data where Aging - Request Date is > 2?

NRAgingPivot.png

1 Solution

Accepted Solutions
sunny_talwar

How about this:

=Sum(Aggr(If(Today() - Max({<[Doc Status] = {'New Request'}, [Is DF Document] = {'No'}, [Sub Doc Type] -= {'VAL1', 'VAL2'},
[CP Doc: DocID]>} [Request Date]) > 2, Count({<[Doc Status] = {'New Request'}, [Is DF Document] = {'No'}, [Sub Document Type] -= {'VAL1', 'VAL2'}>} [CP Doc: DocID])), Name, [Request Date]))

View solution in original post

3 Replies
sunny_talwar

How about this:

=Sum(Aggr(If(Today() - Max({<[Doc Status] = {'New Request'}, [Is DF Document] = {'No'}, [Sub Doc Type] -= {'VAL1', 'VAL2'},
[CP Doc: DocID]>} [Request Date]) > 2, Count({<[Doc Status] = {'New Request'}, [Is DF Document] = {'No'}, [Sub Document Type] -= {'VAL1', 'VAL2'}>} [CP Doc: DocID])), Name, [Request Date]))

vvira1316
Specialist II
Specialist II
Author

Hi Sunny,

Thanks for a quick reply. It worked.

Regards,

Vijay

sunny_talwar

Super