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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
kkarlste
Creator
Creator

Count script table

I don't understand why this not work on table

 

count({<QC_Grade = {'1 '}>} MonthYear)

And first colum is MonthYear

kkarlste_0-1695488867856.png

 

Labels (1)
7 Replies
Vegar
MVP
MVP

Can it be the whitespace in '1 ' that is causing yo6r issue. Try this.

count({<QC_Grade = {'1'}>} MonthYear)

kkarlste
Creator
Creator
Author

Thanks this working

 

kkarlste
Creator
Creator
Author

But I don't know why this not working

Sum( {<MonthYear={'$(=Max(MonthYear))-1}>} QC_EvaluationResult)

Table and show MonthYear colum and must change dimension box MonthYear or Year
and must be MonthYear

kkarlste_0-1695499412284.png

 




Vegar
MVP
MVP

This is your expression.

Sum( {<MonthYear={'$(=Max(MonthYear))-1}>} QC_EvaluationResult)

I find two things that you could try

1. There is no ending quote (') in your set modifier

2. Add the -1 inside the $ expansion

With these changes the expression will look like this

Sum( {<MonthYear={'$(=Max(MonthYear)-1)'}>} QC_EvaluationResult)

I hope these changes helps solving your issue.

kkarlste
Creator
Creator
Author

Not working

kkarlste_0-1695500215771.png

 

Vegar
MVP
MVP

What is MonthYear? Is it a integer, string, date/dual?

Start of by creating a table with MonthYear as a dimension, then three measures 

  • Sum( {<MonthYear={'$(=Max(MonthYear))'}>} QC_EvaluationResult)
  • Sum( {<MonthYear={'$(=MaxString(MonthYear))'}>} QC_EvaluationResult)
  • Sum(QC_EvaluationResult)

If any of the two first measures work, then try to figure out how you can reduce that dimension value by one. 

kkarlste
Creator
Creator
Author

Hi

It's sql table varchar

kkarlste_0-1695545014179.png

This working Sum( {<MonthYear={'$(=MaxString(MonthYear))'}>} QC_EvaluationResult)
but there will be no years and months for the columns

kkarlste_1-1695545287586.png