Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min Max Date function in Qliksense

Dear Friends,

I have a sales history table.

I would like to filter max Transaction date for each material,

There are many fields but I am focusing only on Material and Trasaction date.

Currently I am using following formula

Material

Max(TransactionDate) as MaxTransDate

All other fields are commented.

owever, there is error and i donot get the desired result.

May be you can tell me how to use the max function.

4 Replies
its_anandrjs
Champion III
Champion III

Did you use Group by with this expression.

Ex:-

        Load

        Material,

Max(TransactionDate) as MaxTransDate

        From TableName Group BY Material;

mostwanted123
Creator
Creator

Try this,

Load

Max(TransactionDate) as MaxTransDate

        From TableName ;

Regards,

Pratik Bhor

Not applicable
Author

Anand,

Thanks for your Tip, I was not using Group by.

Now it is giving me desired results.

Cheers.

Raaj

Not applicable
Author

Dears,

I have a table showing Inventory per material, last 6 month sales , previous month sales. This is working fine.

Now user want to see last Transaction date. That's why i asked earlier how to get max date per material.

I am using following script.

NoConcatenate
DailyInventory:

Load *
Resident DailyInventory_tmp;

Concatenate(DailyInventory)
Load *
Resident SalesPV_6Months;


Concatenate(DailyInventory)
Load *
Resident SalesPV_1Month;


Concatenate(DailyInventory)
Load *
Resident MaxTransactionDate;


DROP Table DailyInventory_tmp;
DROP Table SalesPV_1Month;
DROP Table SalesPV_6Months;
DROP Table MaxTransactionDate;

See below result Max Transaction date is not coming in same line but in the second line.

Seems I am doing soemthing wrong.

   

MaterialMaxDateProduct(InventoryQuantity)(P6M_SalesQty)(PM_SalesQty)
000000000000105035             -178.965257.87251.710
00000000000010503529.09.2017000