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

How to get the used expression?

Hi All,

I hope someone already solved my challenge: I use a group of expressions like Sum(Qty) and Sum(Sales). Now I want to show certain other objects (e.g. credits or reference codes) only if the Sum(Sales) expression is shown in the first object. Does anyone know how to reference which of the grouped expressions is currently used?

Thank you all in advance!

Florian Kausler

11 Replies
johnw
Champion III
Champion III

So far as I know, there is no way to reference the currently-selected expression from a group.

That said, you can fake it up by creating field names corresponding to the expressions, putting those field names in a group, and then referencing getcurrentfield(group) inside of a SINGLE expression in the chart. The behavior will be basically the same as grouped expressions, but now other objects can know which "expression" has been selected. Yeah, it's a workaround, but it works.

See attached example.

EDIT: Or not. That doesn't look like the right example. I have way too many examples on my hard drive. I'll try to find an appropriate example.

EDIT: I think I have the right example attached now. In the example, we reference the selected "expression" to change the sort order. But you can make the same reference in other objects as well.

pratap6699
Creator
Creator

object right click-->expression-->group-->cyclic/dropdown-->use anynumber of expressions in group

jrdunson
Creator
Creator

John,

Hello,

just wanted to ask a questions on this... the illustration you give is for dimensions

What if I have cyclic expressions?  Is there a way to show the labels for two cyclic expressions?

It defaults to <get first expression label> Is there a way to display both labels? (i.e. from my second expression?)SecondExpressionLabel.JPG

buzzy996
Master II
Master II

see attachedCapture.PNG

jrdunson
Creator
Creator

Hey, thanks, but as I stated, you listed a way of seeing dimensional cyclic groups, not expression cyclic groups ...How can I get the name of the Expression Cyclic Groups?

johnw
Champion III
Champion III

I've probably misunderstood your question, since the default behavior is to show the label of both cyclic groups. Not as the "title in chart", but as the legend for your two cyclic expressions. I fiddled around in the attached to line up the cycle icons next to the expression label, but there were no special settings or anything.

Capture.PNG

jrdunson
Creator
Creator

Ok... thanks... I can just forego a chart title ...result.JPG

johnw
Champion III
Champion III

I'm not your users, but I like it.

jrdunson
Creator
Creator

thanks again