Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar

Hi,

I have an SQL table that consists of Calendar data, in the said table I have a field fin_year (number e.g. 2011) and I use this field again to create a fin_year_str field (string e.g. FY2011). The problem is if I select on fin_year_str my chart doesn't generate the correct value, here's my expression:

( Sum({<fin_year={$(=Max(fin_year))}>}extended_price)

- Sum({<fin_year={$(=Max(fin_year)-1)}>}extended_price)

)

/ Sum({<fin_year={$(Max(fin_year)-1)}>}extended_price)

Why is this happening?

6 Replies
johnw
Champion III
Champion III

With a string, you need to use the maxstring() function instead of the max() function, something I've always found annoying.

Edit: Ah, you're selecting a string, but the set analysis is on the number.  Never mind.

Not applicable
Author

my filter is fin_year_str

and my set analysis is

( Sum({<fin_year={$(=Max(fin_year))}>}extended_price)

- Sum({<fin_year={$(=Max(fin_year)-1)}>}extended_price)

)

/ Sum({<fin_year={$(Max(fin_year)-1)}>}extended_price)

so if I select FY2011 in fin_year_str then fin_year = 2011, but the chart always give me 0 value

Not applicable
Author

any idea?

rwunderlich

Does it work if you select fin_year (not str) in a listbox? I know this is not the desired solution -- just a debugging question.

-Rob

Not applicable
Author

yes sir. fin_year_str and fin_year are associated fields and came from the same table so i think my set anlysis should work. I'm using QV 11

Not applicable
Author

Hi,

( Sum({<fin_year={$(=Max(fin_year))}>}extended_price)

- Sum({<fin_year={$(=Max(fin_year)-1)},fin_year=>}extended_price)

)

/ Sum({<fin_year={$(Max(fin_year)-1)},,fin_year=>}extended_price)

In your current syntax in the Max(fin_year)-1 in the set analysis you have to override the fin_year.

So when you click fin_year_str you got one year selected in the fin_year so set analysis won't work for the Max(year)-1.

Regards,

Nitin Jain