Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

textbox expression with hierarchy

Hi,

I want to display a picture in a textbox. I do it perfectly with the following expression when something is selected in the field [TimeHierarchy].[Year]:

=if(

     Sum({$<"[TimeHierarchy].[Year].[MEMBER_CAPTION]"={$(#=Only("[TimeHierarchy].[Year].[MEMBER_CAPTION]"))}>}"[Measures].[Energy]")

     -

     Sum({$<"[TimeHierarchy].[Year].[MEMBER_CAPTION]"={$(#=Only("[TimeHierarchy].[Year].[MEMBER_CAPTION]")-1)}>}"[Measures].[Energy]")

     > 0,

     'qmem://<bundled>/BuiltIn/arrow_ne_r.png',

      if(

          Sum({$<"[TimeHierarchy].[Year].[MEMBER_CAPTION]"={$(#=Only("[TimeHierarchy].[Year].[MEMBER_CAPTION]"))}>}"[Measures].[Energy]")

          -

          Sum({$<"[TimeHierarchy].[Year].[MEMBER_CAPTION]"={$(#=Only("[TimeHierarchy].[Year].[MEMBER_CAPTION]")-1)}>}"[Measures].[Energy]"))

          < 0,

          'qmem://<bundled>/BuiltIn/arrow_se_g.png',

          'qmem://<bundled>/BuiltIn/arrow_e_y.png'

     )

)

Now the problem is that if I select something in the next level of the TimeHierarchy: [TimeHierarchy].[Month], I want the conditions to depend on the selected month (itself in the selected year).

In other word, I would like to display the image according to the lowest level of the hierarchy that's activated in my sheet.

I tried some stuffs that didn't work.

Thanks in advance for your advices.

1 Reply
Not applicable
Author

Anybody with a beginning of solution?