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

Count

Hi Friends

I have following data in my QV table

PERIOD_DAYS  POLICY_NO

30                         P1

31                         P20

89                        P61

150                        P2

365                        P4

I want to count no of Policies falling into different period ranges and created calculated dimension as follows

=if(Aggr(sum(PERIOD_DAYS),POLICY_NO)<=31,dual('ONE_MOMTH',1),

   IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)<=93,dual('THREE_MONTHS',2),

   IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)<=186,dual('SIX_MONTHS',3),

     IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)<=270,dual('NINE_MONTHS',4),

       IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)>270,dual('ONE_YEAR',5),

     

        )))))

 

This does give me the desired result. Pls help me to correct it

2 Replies
HirisH_V7
Master
Master

Hi,

Your Dimension ,

1st -

=if(Aggr(sum(PERIOD_DAYS),POLICY_NO)<=31,dual('ONE_MOMTH',1),

  IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)<=93,dual('THREE_MONTHS',2),

  IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)<=186,dual('SIX_MONTHS',3),

    IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)<=270,dual('NINE_MONTHS',4),

      IF (Aggr(sum(PERIOD_DAYS),POLICY_NO)>270,dual('ONE_YEAR',5)

   

        )))))

2-nd

POLICY_NO

expression:

Count(POLICY_NO)

Hope this helps,

PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
swuehl
MVP
MVP

This does give me the desired result. Pls help me to correct it

Sorry, I don't understand your request, it seems you get your desired result, why do you want to correct it?

As Hirish suggested, using an expression like

=Count(POLICY_NO)

with your calculated dimension should show the policy distribution over your time buckets (no need for the second dimension, though).