Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

error in sintax qs

Hi Guys what is wrong with this?

= MaxString({<CampaignYear_Fact = {$(CampaignYear_Fact)-1}>} ValueReviewed)

I would have the ValueReviewed value of the last year. So CampaignYear_Fact -1.


Thanks a lot

1 Solution

Accepted Solutions
avinashelite

Did you tried this

=Aggr(MaxString({<CampaignYear_Fact  = {"$(=Max(CampaignYear_Fact)-1)"}>}ValueReviewed),dimesion)


if it still does not work then please share the sample app

View solution in original post

10 Replies
MK_QSL
MVP
MVP

may be try

=MaxString({<CampaignYear_Fact  = {"$(=Max(CampaignYear_Fact)-1)"}>}ValueReviewed)

avinashelite

$(CampaignYear_Fact)- is referring to variable or field ..if its field the your syntax is wrong

follow Manish approach

pascos88
Creator II
Creator II
Author

it is a field... How I should write it?

avinashelite

Follow Manish approach that should work

=MaxString({<CampaignYear_Fact  = {"$(=Max(CampaignYear_Fact)-1)"}>}ValueReviewed)

pascos88
Creator II
Creator II
Author

doesn't works, still in the table I got Invalid dimension. CampaignYear_Fact  is a field, and I would have info about  ValueReviewed but last years, than something like CampaignYear_Fact- 1

avinashelite

Your trying this in the dimension ?? try like this then

=Aggr(MaxString({<CampaignYear_Fact  = {"$(=Max(CampaignYear_Fact)-1)"}>}ValueReviewed),dimesion)

pascos88
Creator II
Creator II
Author

unfortunately doesn't....

chinnuchinni
Creator III
Creator III

CampaignYear_Fact  is in year foamat or date_format ?



if it is in date format,use the below:


=MaxString({<CampaignYear_Fact  = {"$(=Max(Year(CampaignYear_Fact))-1)"}>}ValueReviewed)

pascos88
Creator II
Creator II
Author

it is already in year, with this formula I get an Invalid dimension, even if the script in the table looks good. I mean onche I write the set expression, there is no error..