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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Windy
Contributor
Contributor

Error in Expression:'}' expected for showing past 12 month dates

I need to create a bar chart that counts the number of distinct facilities in the trailing 12 month of the selected As_Of_Date. For example, if 03/31/2025 is selected, I need to show a bar chart showing each month facility could from 04/30/2024 to 03/31/2025. 

My data is only on month ends (business days), which means I only have one As_Of_Date in each month.

The dimension is As_Of_Date. This script provided by gpt on the measure is giving me erorr 'Error in Expression:'}' expected':


Count({
<As_Of_Date = {">=$(=Date(AddMonths(Max(As_Of_Date), -11), 'MM/DD/YYYY'))", "<=$(=Date(Max(As_Of_Date), 'MM/DD/YYYY'))"}>
>} distinct facility_id)

 

What should I do to get the right measure?

 

 

Labels (1)
1 Reply
ali_hijazi
Partner - Master II
Partner - Master II

Count({
<As_Of_Date = {">=$(=Date(AddMonths(Max(As_Of_Date), -11), 'MM/DD/YYYY'))      <=$(=Date(Max(As_Of_Date), 'MM/DD/YYYY'))"}>
>} distinct facility_id)

 

syntax is as follows:
{<Field={" >= value <= value2"}>} and not {<Field{">=value","<=value2">}

I can walk on water when it freezes