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

need help

Hi All,

Please help me achieve below requirement in a QV Straight/Pivot table

   

IDNumber of Meetings OccuredMeetingsReasons
127/10/2013Discussions
10/11/2013additional details
2424/6/2014Missing Key Attendees
6/8/2014Not enough details
26/6/2014N/A
25/5/2014Meeting cancelled

Requirement is to create a table having ID, #Meetings occured, and to get the latest meeting for each ID and the Corresponding Reason for it.

For example

my table should look like below

IDNumber of Meetings OccuredMeetingsReasons
1210/11/2013Additional details
246/8/2014Not enough details

Please help.

any suggestions appreciated.

Thanks & regards

Jyothi

1 Solution

Accepted Solutions
IAMDV
Luminary Alumni
Luminary Alumni

Hi Jyothi,

FirstSortedValue() function does what you need and it also supports Set Expression. Check my blog to understand how it works...

http://qlikshare.com/tag/firstsortedvalue/

Cheers,

DV

View solution in original post

10 Replies
MayilVahanan

Hi

Try like this

Temp:

LOAD If(Len(ID) = 0,Peek('ID'), ID) As ID,

     If(Len([Number of Meetings Occured]) = 0,Peek([Number of Meetings Occured]), [Number of Meetings Occured]) As [Number of Meetings Occured],

     Meetings,

     Reasons

FROM

[https://community.qlik.com/thread/166935]

(html, codepage is 1252, embedded labels, table is @1, filters(

Remove(Row, Pos(Top, 8))

));

NoConcatenate

Result:

LOAD ID ,[Number of Meetings Occured], Date(Max(Meetings)) as LatestMeeting, FirstSortedValue(Reasons, -Meetings) as Reasons Resident Temp

Group by ID, [Number of Meetings Occured];

DROP Table Temp;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sunny_talwar

Try this:

Table:

LOAD RowNo() as Key,

  ID,

     [Number of Meetings Occured],

     Date#(Meetings, 'DD/MM/YYYY') as Meetings,

     Reasons

FROM

[https://community.qlik.com/thread/166935]

(html, codepage is 1252, embedded labels, table is @1, filters(

Remove(Row, Pos(Top, 8))

));

Table1:

NoConcatenate

LOAD If(Len(Trim(ID)) = 0, Alt(Peek('ID'), 0), ID) as ID,

  Meetings,

  Reasons

Resident Table

Order By Key;

Join(Table1)

LOAD ID,

  [Number of Meetings Occured]

Resident Table

Where Len(Trim(ID)) <> 0;

Right Join(Table1)

LOAD ID,

  Max(Meetings) as Meetings

Resident Table1

Group By ID;

DROP Table Table;

qlikoqlik
Creator
Creator

Hi Jyothi

Can you do this in the load script?

If you had to do in the chart:

No of meetings would be straight forward ; count(ID)

Latest Meeting Date : =aggr(max(Meetings),ID)

I am still figuring out how to get the relevant reasons

regards

Padma

IAMDV
Luminary Alumni
Luminary Alumni

Hi Jyothi,

FirstSortedValue() function does what you need and it also supports Set Expression. Check my blog to understand how it works...

http://qlikshare.com/tag/firstsortedvalue/

Cheers,

DV

qlikoqlik
Creator
Creator

Jyothi

what Deepak said works beautifully in a chart

To get the latest date

=FirstSortedValue(Meetings, - Meetings)

To get the relevant Reaosns:

=FirstSortedValue(Reasons,- Meetings)

Thanks

Padma

Not applicable
Author

Thanks Deepak

Not applicable
Author

Thank You

Not applicable
Author

Hi Sunindia,

I was looking for implementing it in chart expression and my mistake i dint mention in the question. Thank you

sunny_talwar

No problem my friend. I am glad that it got resolved

Best,

Sunny