Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
venkat1
Creator II
Creator II

how to write an expression for showing max date of sales if year month are not selected ?

Hi Experts,

i have year and months selection fields and a pivot table,

How to write an expression if i not selecting the year and month then in pivot table it should show me sales for the max date?

7 Replies
tresesco
MVP
MVP

Try like:

Sum({<Date={'$(=Date(Max(Date)))'}>}Sales)
venkat1
Creator II
Creator II
Author

but should work by selecting on the year and month field also,if the selection was on the year and month then it sould display max date of sales.

tresesco
MVP
MVP

It would work, with/without selections ... try and let know.

venkat1
Creator II
Creator II
Author

Sum({<D.VOU_DATE={'$(=Date(Max(D.VOU_DATE)))'}>}D.BILL_AMOUNT)

i tried this this was not working .

tresesco
MVP
MVP

What is the output you get if use expression: =Max(D.VOU_DATE)) in a textbox?

venkat1
Creator II
Creator II
Author

0

tresesco
MVP
MVP

0 or null? Probably null. And this could be because your date field is a string field. You need to convert your date field into a proper date field that has a number as under-laying value using parsing functions.

 

Read this : Why don't my dates work