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

FirstSortedValue or set analysis

Hi, I have this table

Immagine2.bmp

I need to create a pivot table with ProductType as dimension and in expression the value of status for the max(Date) of ProductType

I try to use

max({<Date={"$(=max(Date))"}>} Status)

but the result is not correct. So I try to use


FirstSortedValue(distinct Status, -Date)

But I'm not sure that it is the best solution.

Help me on this...urgent

Thank you




5 Replies
SunilChauhan
Champion
Champion

use below in your Expression

Only({<Date={"$(=max(Date))"}>} Status)

hope this helps

Sunil Chauhan
er_mohit
Master II
Master II

hiii

try this in script level

LOAD producttype,

ID,

max(Date)as maxDate,

FirstSortedValue(Status,-Date)as Status 

group by producttype;

load ur table fields

from ......;

Not applicable

hi

try this

LOAD producttype,

date(max(date))as maxDate,

FirstSortedValue(status,-date)as Status

group by producttype;

LOAD auditnmame,

     date,

     id,

     producttype,

     status

FROM

C:\Users\vishwaranjan\Desktop\FIRSTSORTED.xlsx

(ooxml, embedded labels, table is Sheet1);

then output like this

producttypemaxDateStatus
AA2/1/2013BADX
BB1/2/2012GOOD
CC5/1/2013GOOD
paolojolly
Creator
Creator
Author

I'm sorry but this does not work

paolojolly
Creator
Creator
Author

Thanks, This solution help me, but now I have another problem. I have changed the table in

Immagine3.bmp

and I need to create a pivot table with ProductType as dimension and in expression the value of status for the max(Date) of ProductType and I need to use a list box for filter the information on SalesRep and another for Customer. For example If i select in Customer list box "Cust1" the pivot shoud give me for each ProductType the values of Status field for the max(Date), idem if I work with SalesRep listbox

Thanks