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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Formatting In Set Analysis

I'm trying to implement an expression with set analysis:

=(NumFiled+1)/(only({<Cal.Date={"$(=Date(Min(Cal.Date),'DD-MMM-YY'))"}>}NumField)+1)-1

Can't figure out where I'm doing wrong.

Labels (1)
3 Replies
Miguel_Angel_Baeyens
Support
Support

Hi,

If you do a Date() on Cal.Date, do you get a numeric value? If so, make sure that the Only() function returns actually only one value (use it in a text object, for example, and use Min({1} Cal.Date) instead). Finally, the result of the Date() function must be in the same format that the Cal.Date format (e.g.: if it's a complete timestamp with hours, minutes and seconds, you will need to add them).

Hope that helps.

Miguel

Not applicable
Author

try this

=(NumFiled+1) / (sum({<Cal.Date={"$(=Date(Min(Date(Cal.Date,'DD-MMM-YY')))"}>}NumField)+1)-1

Anonymous
Not applicable
Author

Thank you both. Actually, my date formatting was not matching Cal.Date format ('DDMMMYY' and not 'DD-MMM-YY'), also used {1} and "sum" instead of "only". So, the expression that worked is:

=(NumField+1)/(sum({<Cal.Date={"$(=Date(Min({1} Cal.Date), 'DDMMMYY'))"}>}NumField)+1)-1

Thank you again.