Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparasion in Set Analysis with variables

Hello,

I have a issue with one of my KPI:

I need do a sum of one of my column, it's a number of persons.

But I want do this count with dimension category and a dimension Adult/Children.

My problem is that dimension Adult CHildren is not fixed. I need calcul with the birthday and a date selectioned by the user in a calendar, the age of each personne and count the person in the field Adult or Childre.

For this, I have create in a multidimensional chart, with one dimension : Category and two expressions :

One for count the numbers of persons in Adult and the other for Children.

I have create three variables :

LET vSetAge     =  num((Date(Min(CALENDRIER_Choix.Date_Choix),'DD/MM/YYYY')-date([RECEVEUR.Date de Naissance],'DD/MM/YYYY'))/365)

LET vSetAdulte =  IF(num((Date(Min(CALENDRIER_Choix.Date_Choix),'DD/MM/YYYY')-date([RECEVEUR.Date de Naissance],'DD/MM/YYYY'))/365)>=18,1,0)=1

LET vSetEnfant = IF(num((Date(Min(CALENDRIER_Choix.Date_Choix),'DD/MM/YYYY')-date([RECEVEUR.Date de Naissance],'DD/MM/YYYY'))/365)<18,1,0)=1

And my expression is :

Sum({<$(vSetAdulte)>}[Nb Mise en attente])

When I put the variable vSetAdulte like an expression I have 1 or 0 in the column but in the set analysis it's not works....I don't have nothing in my column. Can you help me please? I have past one day with many forms but I don't understand why it's not works.

Kind Regards,

Bruno

1 Solution

Accepted Solutions
Not applicable
Author

I have found the answer.

To do this, you must use the Calculated Dimension :

=AGGR(IF(num((Date(Min(CALENDRIER_Choix.Date_Choix),'DD/MM/YYYY')-date([RECEVEUR.Date de Naissance],'DD/MM/YYYY'))/365)>=18,'Adulte','Enfant'),KEY_RECEVEUR)

Thanks for your help.

Kind Regards,

Bruno Martins Lêdo

View solution in original post

11 Replies
Not applicable
Author

Hello,

Nobody have idea please it's crucial for me, if you have idea or commentary don't hesitate

Kind Regards,

Bruno

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

  

   Is it possible for you to upload the qvw file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Yes Sure. Thanks for your help.

You can see my problem in the second TAB Feuille 1

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    As per the data what ever you have done is right.

    Can you describe me what you want.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

In the Feuille 1. Normaly I have a column TOTAL, and After TOTAL NR. It's work normaly but I want too A column with the KPI for Only TOTAL Adult personn, TOTAL Adul Personn NR, and the same for Children.

I want 6 colmun in this table.

My problem, is when I want use my Variables in the set Analysis, I don't have any number but only '-' values because I don't succeed calcul the set Analysis to see if a Personn was Adult Or Children in the date choose by the user.

Not applicable
Author

Hello,

Have you an Idea for this after I explain my problem?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Your set analysis is not proper. Can you please explain in detail what you want with an example.

    If possible give the desired output in table.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

I want calcul the number of Operations preview after the date I have choose in the calendar.

And I want 3 KPI :

- The number total of operations

- The number of Operation who concern an adult (have more or equal of 18 year)

- The number of Operation who concern a child (Have less of 18 year old)

To count an operation in the KPI : We need see if the date of Attente is more importante or equal at the date choose by the user.

Person BirthDate
A01/01/1980
B01/06/2007
C01/06/2002
D01/09/1975

PersonnDate of AttenteNb OperationsCAT
A01/01/201011
A02/05/201512
B02/06/202432



C06/03/201521
C06/06/200033

And the result is :

I choose the date 01/02011
CATNb TOTAL Adult TOTALChildren TOTAL
1220
2413
3303

I hope it's help you to understand? The age need be calculated for all changement by the user of the date choose.

Kind regards,

Bruno Martins Lêdo

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   In your example which field is used for CAT,NB, Date of attente, Person, Birthdate,Selected Date.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!