Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

Format Date in Set analysis

I want to use below expression but it gives error,

please help me to correct it

count({$<Date(MY_date,'YYYY-MM-DD')={$(=Max(MY_date)-1)}>}Country)

5 Replies
avinashelite

you should set the left hand side of the expression  in the script and then need to compare the same

Date(MY_date,'YYYY-MM-DD') set this in the script and then use

or try once like this :

count({$<Date(MY_date,'YYYY-MM-DD')={"$(=Max(MY_date)-1)"}>}Country)

tresesco
MVP
MVP

You can't put an expression in the LHS section of set analysis, that has to be a field (script generated). Hence, you better try to format the date in the RHS of your set comparison, like:

count({$<MY_date={"$(=Date(Max(MY_date)-1), 'DD-MM-YYYY') "}>}Country)


Change the date format as it is with My_date field.

jagan
Luminary Alumni
Luminary Alumni

Hi,

You cannot do any formatting or any calculations in Left hand side of the set analysis expression, instead you have make the changes in the RHS as required like below

count({$<MY_date={"$(=Date(Max(MY_date)-1, 'YYYY-MM-DD'))"}>}Country)


Note: YYYY-MM-DD replace with actual MY_Date format, so that the expression works.


Regards,

Jagan.

Kushal_Chawda

try this

count({$<MY_date={"$(=date(Max(MY_date)-1,'YYYY-MM-DD'))"}>}Country)

smirkinaa
Contributor III
Contributor III

You connot use expressions like "set_identifier". I suggest you to prepare additinal field with suitable format of date in script and use it in set analysis. Moreover, using numeric presentation of date is more effective then text format of date.