Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Current vs Previous term - Urgent help if possible!!

Hello.

I am creating a dashboard, and one of the features I want to implement is to have a page where it shows the total GWP for the Max Policy and the previous Policy, and to have the comparison.

Sum({<PolicyEffectiveDateCh = {"$(=Max(PolicyEffectiveDateCh))"}>} GrossWrittenPremium) - I currently am using this expression which calculates what I want, but only when I select a certain Policy. When I have not made a selection, the sum is not correct.

Sum({<PolicyEffectiveDateCh = {"$(=Max(PolicyEffectiveDateCh)-1)"}>} GrossWrittenPremium) - When I try this - I wanted to select the Max Policy Effective Date -1 to select the record before the Max record, however the output comes as 0, when I select a certain policy or when I have no selections?

Once I have these calculations, I am able to do the comparison between the two. Can anyone help me do a total GWP for each Max record of PolicyNumber? and then the prior record GWP?

Thanks

Labels (3)
2 Replies
Digital Support
Digital Support

Have a look at the following Design Blog posts, believe they should be helpful on this one:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Section-Access/ba-p/1465766

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

Here is the base link to the Design Blog area in case you want to search further on your own:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Highlighted
Contributor III
Contributor III

Hello,

Try this

Sum({<PolicyEffectiveDateCh = {"$(=Max(PolicyEffectiveDateCh,2))"}>} GrossWrittenPremium)