Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tauceef9
Creator
Creator

how to use P() function for latest date only

Hi All,

I have a KPI called Not-Installed Patches, where in I am counting all the Patches which are not installed in any of the computers. A Patch can be linked with multiple computers and if it is not installed in any single computer as well it will be counted as Not-Installed.

I am using below set analysis for the same:

count( {$<Patch_SNO = P({$<[UpdateStatus]={'NotInstalled','Downloaded'}>}Patch_SNO),[Report Date Num]={'$(vMaxCalendarDate)'}>}distinct Patch_SNO)

It works when we don't select anything from the filters Just noticed, it is not working even if I don't select anything.

Thing is like this set analysis is considering entire data set (from database) instead of current selection. but when I select a filter let's say a "Computer" which is all Patched but one of the Patch is displaying as Not-Installed.


When I am selecting any Computer from the filters it is showing all those Patches as not installed which are actually not installed (may be once in the history or for other computers) in the database.

In actual this Patch is installed on the selected computer but it is not installed in another computer, and this Patch is coming as Not-Installed for the selected and all the computers linked to this Patch. It means the above P() function in considering all the computers instead of current selected computer.

I have already applied filter to pick the data for latest date

Report Date Num]={'$(vMaxCalendarDate)'}

still it is considering history dates as well.

I want to apply the above set analysis for the current selection only and for the latest date.

Please help me with this.

Regards,

Tauceef

Message was edited by: Tauceef Sheikh

Message was edited by: Tauceef Sheikh

Message was edited by: Tauceef Sheikh

12 Replies
tauceef9
Creator
Creator
Author

I have tried many options but nothing seems to be working :

1.Giving Date filter inside E()

=Count({<ComputerID=E({<[UpdateStatus]={'NotInstalled','Downloaded'},[Report Date Num]-={'$(vMaxCalendarDate)'}>})>}Distinct ComputerID)

2.Using if() for date condition

=if([Report Date Num]="$(=vMaxCalendarDate)",Count({<ComputerID=E({<[UpdateStatus]={'NotInstalled','Downloaded'}>})>}Distinct ComputerID))

3. Using if() for date after set

=Count({<ComputerID=E({<[UpdateStatus]={'NotInstalled','Downloaded'}>})>} if([Report Date Num]="$(=vMaxCalendarDate)",Distinct ComputerID))

I can see that E() or the P() functions always looks for entire dataset, isn't there a option to restrict them to a particular dates set or a date?

Regards,

Tauceef

tauceef9
Creator
Creator
Author

Hello Experts,

Please help me solve this problem. Sorry, I know I am breaking the forum rules but need to solve this on urgent basis. Looking forward for a response.

I have tried to share as much details and findings as I can. Let me know if anything more is required.

Regards,

Tauceef

sunny_talwar

Based on the sample you have shared, what is the expected output for the KPIs you mentioned above?