Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There
I have a basic graph with sales for example.
I want the dimension for the graph to be Year when no year is selected or Month when there is a year selected.
To test this is possible i enter the following in the calculated dimension expression:
=if(1=1,Year,Month)
This work when i change the 1=1 to 1<>1, the dimension changes to Month or Year accordingly.
BUT ic annot get this to work:
=if(count(distinct(Year))=1,Month,Year)
It just says error in calculated dimension, obviously I am just checking to see if a year is selected and then change the dimension.
What am I doing wrong ?
Thanx
Try:
=if(GetSelectedCount(Year)>0, Month, Year)
There are probably quite a few different methods to accomplish this, but I like the built-in QlikView selection functions. Also, see GetFieldSelections(), which will give you a list of the actual selections in a field.
EDIT: I think the problem with your functions is it should be:
=if(count(distinct Year)=1,Month,Year)
Try:
=if(GetSelectedCount(Year)>0, Month, Year)
There are probably quite a few different methods to accomplish this, but I like the built-in QlikView selection functions. Also, see GetFieldSelections(), which will give you a list of the actual selections in a field.
EDIT: I think the problem with your functions is it should be:
=if(count(distinct Year)=1,Month,Year)