Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Highlighted
paulista
New Contributor III

Re: Find all the columns for the maximum time.

count(distinct if(HDR_TIMESTAMP = aggr(NODISTINCT max(HDR_TIMESTAMP), HDR_CORR_ID), HDR_CORR_ID))

it gives me the correct count when i type this.

not when i take hdr_event_type, why would that be ?

also when i click on the value it changes to a value which is not a correct number .

 

 

 

 

 

 

zhadrakas
Valued Contributor II

Re: Find all the columns for the maximum time.

with your current statement you are calculating the max(timestamp) per ID, which is not what you wanted.

You wanted the max(timestamp) per ID & Event & Activity.

So you need to aggregate over this three dimensions:

count(distinct if(TIMESTAMP = aggr(NODISTINCT max(TIMESTAMP), ID, [Activity Name], EVT_TYPE), ID))

count(distinct if(TIMESTAMP = aggr(NODISTINCT max(TIMESTAMP), ID, [Activity Name], EVT_TYPE), ID))

 

 

 

Highlighted
paulista
New Contributor III

Re: Find all the columns for the maximum time.

see th table in left should guve me 34 total, but if you see at distinct events , they dont add up to 34 but much moresee th table in left should guve me 34 total, but if you see at distinct events , they dont add up to 34 but much more

 

 

table on the left shows me a total of 34 but yif you add up the individual counts its much more , it should add upto 34