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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis not working


I have Date field in my data model and I am using below expression to get the sales but unfortunately it's not working

Format of Date field is DD-MM-YYYY

 

=sum({<Date={"$(=max(Date))"}>}Sales)

1 Solution

Accepted Solutions
Kushal_Chawda

May be your date is in text format. try to convert it in Date format by

date(date#(YourDateField,'DD-MM-YYYY'),'DD-MM-YYYY') as Date then use your expression

or use below expression

sum({<Date={"$(=max(date#(Date,'DD-MM-YYYY')))"}>}Sales)


=sum({<Date={"$(=max(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')))"}>}Sales)

View solution in original post

4 Replies
Kushal_Chawda

May be your date is in text format. try to convert it in Date format by

date(date#(YourDateField,'DD-MM-YYYY'),'DD-MM-YYYY') as Date then use your expression

or use below expression

sum({<Date={"$(=max(date#(Date,'DD-MM-YYYY')))"}>}Sales)


=sum({<Date={"$(=max(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')))"}>}Sales)

maxgro
MVP
MVP

you need the same format as your Date field also for the right part, DD-MM-YYYY, add a Date formatting function;

if your date format (SET DateFormat='DD-MM-YYYY'; at the beginning of the script is DD-MM-YYYY just the Date function

=sum({<Date={"$(=Date(max(Date)))"}>}Sales)


if your date format (SET DateFormat='DD/MM/YYYY'; at the beginning of the script isn't DD-MM-YYYY the Date function with the format DD-MM-YYYY

=sum({<Date={"$(=Date(max(Date)), 'DD-MM-YYYY')"}>}Sales)

Not applicable
Author

Thanks a lot ,your guess was correct. Date field was in text format. I didn't recognize. My bad.

Not applicable
Author

thanks maxgro for your response. It is helpful but unfortunately will not help as Date was in text format.