Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

berryandcherry6
Contributor II

Aggr records of first record in the selection

Hi,


I have a requirement where when user selects batches in filterpane, based on batch selected, only first campiagn(i.e min campaign ID) of selected batch's count of invitation have to be displayed


For this i have used below set analysis:

Count({$<DateTimeType = {'open_time'},campaign_id={"$(=min(campaign_id))"},opened = {'1'},client_id = {'12'},batch_id={'2','3','6'}>}distinct invitation_id)


But this is taking first campaign(i.e min campaign ID) of client and giving count of that campaign regardless of batch selection.


I want count of invitation of first campaign of the batch selected. How could i do this?

1 Solution

Accepted Solutions

Re: Aggr records of first record in the selection

May be this

Count({$<DateTimeType = {'open_time'}, campaign_id = {"$(=min(campaign_id))"}, opened = {'1'}, client_id = {'12'}, batch_id *= {'2','3','6'}>} DISTINCT invitation_id)

6 Replies

Re: Aggr records of first record in the selection

When you say batch selection, you mean to say you are selecting in batch_id field?

berryandcherry6
Contributor II

Re: Aggr records of first record in the selection

Yes, batch_id field in filter pane.

Re: Aggr records of first record in the selection

May be this

Count({$<DateTimeType = {'open_time'}, campaign_id = {"$(=min(campaign_id))"}, opened = {'1'}, client_id = {'12'}, batch_id *= {'2','3','6'}>} DISTINCT invitation_id)

berryandcherry6
Contributor II

Re: Aggr records of first record in the selection

Hi Sunny,

Even my expression working fine. I was wrongly analysing the data.

Can you explain reason to add * after batch_id. What does it do?

Re: Aggr records of first record in the selection

berryandcherry6
Contributor II

Re: Aggr records of first record in the selection

Thanks Sunny. Even your answer works so i am marking as correct answer.

Community Browser