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: 
Not applicable

Error in small script ?

Sum({$<$(vSetPreviousNMonth(0))>} [# Departures Performed])


I see an error after - second curly brace, ie }. What is the error ? This is taken from the book, qlikview 11 for developers.

Variable definition is -


PeriodID = {$(=Max(PeriodID) – $1)},

Year = ,

Quarter = ,

Month = ,

Period =

Book output -

b1.JPG.jpg

My output -

b2.JPG.jpg

1 Solution

Accepted Solutions
chiru_thota
Specialist
Specialist

You have wrong character in your variable vSetPreviousNMonth and I have corrected it.It has some bad character as shown below

also mentioned the right expression below.

Airplane2.jpg

Airplane.jpg

View solution in original post

5 Replies
chiru_thota
Specialist
Specialist

Can you add your QVW here ?

Mean while add one more expression as sum(1) and see are you getting all values for Carrier Group

Not applicable
Author

QV Script.JPG.jpg

PeriodID = {$(=Max(PeriodID) - $1)},

Year = ,

Quarter = ,

Period = ,

Month =

I added this to my expression and seems to be working fine.

Start with changing the dimension. Did you get the carrier Group from Carrie Group qvd?

Not applicable
Author

The qvd is attached. Sum(1) gives me all zeros in all columns. What is the meaning of sum(1) ?

chiru_thota
Specialist
Specialist

You have wrong character in your variable vSetPreviousNMonth and I have corrected it.It has some bad character as shown below

also mentioned the right expression below.

Airplane2.jpg

Airplane.jpg

Not applicable
Author

Thank you very much !