Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sogloqlik
Creator
Creator

Show Latest update date only

Hi.

I Have  a straight table with 4 columns: Customer. Product, Update date and inventory (Quantity).

Not all the customers are updated daily and not all the products for a customer are updated in each update.

For each combination of customer & product, I need to show the latest update only.

How can this be achieved? 

Regards,

Motty

 

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @sogloqlik 

Try like below

Aggr(max([Update date], customer , product)

or

Max(Aggr(max([Update date], customer , product))

Thanks & Regards,
Mayil Vahanan R

View solution in original post

5 Replies
QFabian
Specialist II
Specialist II

Hi @sogloqlik , here a sample of scripting for doing what you ask.

tell me if it works.

 

Data:

Load

Customer & ' | ' & Product   as %_Key,

Customer.

Product,

[Update date],

inventory

From yoursource;

 

Data2:

Load

%_Key,

max([Update date])   as [Max Update date]

Resident Data

group By %_Key;

QFabian
sogloqlik
Creator
Creator
Author

Hi.

 

Thx for your answer

Cant do it in the script. must be in the chart itself.

MayilVahanan

Hi @sogloqlik 

Try like below

Aggr(max([Update date], customer , product)

or

Max(Aggr(max([Update date], customer , product))

Thanks & Regards,
Mayil Vahanan R

View solution in original post

dilipranjith
Partner
Partner

@sogloqlik  try mayils suggestion.

i would actually suggest a variation of @QFabian  s suggestion. in the script using max create  a flag which indicates the latest records for your combination.

then use that flag in set analysis. this would be most efficient and flexible way. aggr will work but can be a little heavy on processing.

Data:

Load
   Customer & ' | ' & Product   as %_Key,
   Customer,
   Product,
   [Update date],
   inventory
From yoursource;

left join (Data)
Load
   %_Key,
   max([Update date])   as [Max Update date]
   'Y' as LatestFlag
Resident Data
group By %_Key;
sogloqlik
Creator
Creator
Author

Combination of that on the Date and first sorted value on the Qty Solved the problem.

 

Thx.