Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count new enteries

Hi

I have a table with 2 columns. Column one is the name of the ceremonies and the second one is for participants of that ceremony.

Now i want to have the number of new persons in each ceremoney.

this is my table:

Person_Code     Ceremony

50                       a

        50                    b

        50                    c

        51                    b

        52                        b

so the result should be like this:

ceremoney    number_New_Participants

a                         1      =(50)

b                         2     =(51,52) (not 50 because it is in a ceremony)

c                         0      (not 50 because it is in a ceremony)

can you please help me making the formula.

thank you very much in advanced.

    

11 Replies
SunilChauhan
Champion II
Champion II

how you identify that perticular person is in ceremony or not

?

Sunil Chauhan
swuehl
MVP
MVP

Hi MK_Komaei,

If I understood you correctly, the temporal order of your Ceremonies is determined by alphabetical order of their names.

If so, I think you could use something like

=count( if(aggr(NODISTINCT MinString(aggr(Ceremony,Ceremony,Person_Code)),Person_Code)=Ceremony,Person_Code))

as chart expression.

Alternatively, you could do similar in the script using a group by LOAD.

See attached sample.

Hope this helps,

Stefan

edit: And if you Ceremonies are ordered by something else, you could probably just add a numerical CeremonyOrder field and use this field and  Min instead of MinString in above expression.

Not applicable
Author

Thank you for your response,

But in fact it did not help me. as I changed the ceremony from alphabetic into a code as below but the result will be changed incorrectly.

I changed

a=10012

b=102

c=1003

d=100224

Not applicable
Author

Thank you for your response,

But in fact it did not help me. as I changed the ceremony from alphabetic into a code as below but the result will be changed incorrectly.

I changed

a=10012

b=102

c=1003

d=100224

the file is attached below.

swuehl
MVP
MVP

Hi MK_Komaei,

you need to somehow define the order of your Ceremonies, otherwise it's hard to say when to count a Person_Code as new entry.

I assume that in your sample, you define this order by load order.

As I said, all you need to do is adding a column with the Ceremonies order, see attached as how I do this for load order.

If you have more information, e.g. a Ceremony date, you could use this date as order (a recognized date has a numerical representation).

Hope this helps,

Stefan

Not applicable
Author

Hi there.....check the attached doc....I've changed one small bit in the script.

Not applicable
Author

Forgot to mention, the qv doc I used is swuehl's....just changed one line in there..

qliksus
Specialist II
Specialist II

Hi,

try this in expression

count(aggr(Person_Code,Person_Code))

IAMDV
Luminary Alumni
Luminary Alumni

qliksus - Very clever workaround.

Cheers - DV