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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Variable error

Hi,

I have created an variable in script but it is showing an script error,but i have tested the same in text object its working fing fine.

Please find the below error.

Variable : let vCurr_Month_Year = month(monthstart(max(ActivityDate-1)))&' '&(year(max(ActivityDate-1)));

Untitled.png

Thanks..

38 Replies
gireesh1216
Creator III
Creator III

vMax=max(ActivityDate)



month name is not required.

gireesh1216
Creator III
Creator III

please find below image

aa.PNG

nareshthavidishetty
Creator III
Creator III
Author

Hi,

Attached is the sample application and source.

Here please check the table month and year label now it is static like based on filter selection it won't reflect but we need this as dynamic,suppose if we select any month the same would be reflect in the table lable.

Thanks..

gireesh1216
Creator III
Creator III

Ok. Please attach your data...We will work on that..I will let you know

nareshthavidishetty
Creator III
Creator III
Author

Hi,

I have attached sample data as well in the previous post.

Please check once.

Thanks..

gireesh1216
Creator III
Creator III

Thanks ...

rubenmarin

Hi Naresh, if you want to change the value of the calculated dimension you can use something like:

=Dual(Text(Date(Max(TOTAL [Activated Date]), 'MMM YYYY')),KPI)

or simpler:

=Date(Max(TOTAL [Activated Date]), 'MMM YYYY'))

But I don't know what are you trying... you load an inline table with a fixed value for KPI, so you can change the 'label', but the data loaded will remain the same.

nareshthavidishetty
Creator III
Creator III
Author

Hi Ruben,

We need the date for last year

=Date(Max(TOTAL [Activated Date]), 'MMM YYYY'))


Thanks..

rubenmarin

Same date but for previous year?

=Date(AddYears(Max(TOTAL [Activated Date]), -1), 'MMM YYYY'))