Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
I have a time dimension and an expression based on a growth variable (e.g. 10% growth per month). If the user zooms in to weekly, daily or lower levels the formula won't work because the corresponding growth rate refers to month number.
Is it possible to use an if statement to define the variable dynamically based on the dimension? E.g. different expression for, month, week, and so on?
Kr.
Daniel
I assume you are using a group with your dimension, right?
Then try using system function GetCurrentField() in your if() statement's condition:
returns the name of the field currently active in the group named groupname.
Example:
getcurrentfield( MyGroup )
No just regular time dimensions: year, month, week and so on. Qlikview automatically allows users to drill down, you don't need to group time dimensions.
Something like this maybe:
if( getpossiblecount(day) = 1, dayexpression,
if( getpossiblecount(week) = 1, weekexpression,
if( getpossiblecount(month) = 1, montexpression, yearexpression )))
If you are using multiple dimensions like year, month, date without a dimension group, I believe you are not drilling down, just selecting some dimension values, aren't you? I mean, the granularity is not changing, because whatever you select, your expression is always evaluated in the smallest granularity of dimensions year, month, date (i.e. date), right?
I am probably missing something essential here, could you post a small sample app?
Swuehl, let's just say it's friday.. Indeed I created a group a long time ago.. which allows drill down functionality. Apart from the drilldown group I also have several listboxes where users can indeed select.
The if statement solution should work. Thanks a lot!