Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to refer to a grouped dimension in a conditional expression?

Hi to all!,

I have a dimension made of three dimensions (Quarter, Month,Week); I have a cyclic graph with those and a reference line that I want to be shown only for "Quarter" graph. How can I refer to the grouped dimension value "Quarter" in the reference line conditional formula? What kind of formula you suggest me? I tried with the "IF" but my results were not so good....


Thanks

Francesco

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You have to adapt the formula.

When I ask yours dimensions it's because I need to know fields names IN the group.

=If (GetCurrentField("Calendar") = 'week', week(QuarterEnd(makedate(cYear,2,15)))+1)

Please, Could you send you application. I will built the formula and give you back it.

View solution in original post

11 Replies
Not applicable
Author

Hi,

Someting like that: if (GetCurrentField("groupName")='Quarter, referenceline)

Not applicable
Author

....sorry, but it doesn't seems to be working.....

I have a cyclic group set as dimension that has three values (Week, Quarter, Month) ant I've inserted a reference line in a bar chart to show the quarters. I am trying to let the graph automatically hide the reference lines if the cyclic group dimention is set on values other than week....

With your formula it doesn't recognise referenceline....

Thanks

Francesco

Not applicable
Author

Possible for you to attach the sample application as to what you are trying to do.

Not applicable
Author

Please, See the qvw below. I did it in the reference line expression but you can also do that in the conditionnal formating

In the exemple it's not a cyclic group but a drill down one... doesn't matter.

Not applicable
Author

Hi,

this is the graph with reference lines

Reference lines.JPG

that shows red quarter lines on the chart if the x dimention i set to "week"

I just wat that in the following chart:

No reference lines.JPG

those red lines will disappear....

Thanks!!

Not applicable
Author

I'm sorry, I cannot open other QLV files other than mines.... 😞

Not applicable
Author

Ok,

In presentation, edit your reference Line.

In the expression  not tpye a value but a formula.

=If (GetCurrentField("Namegroup") = 'week', value)

Please adapt the formula or give us the application. Or give us the name of

-your cyclic group

-yours dimensions

-the line value

Not applicable
Author

Hi all,
in the expression field I already have the following formula:

week(QuarterEnd(makedate(cYear,2,15)))+1

than if I put your formula in the Conditional field it doesn't work....

The names of:

-your cyclic group ---- Calendar

-yours dimensions ----- is the cyclic group "Calendar"

-the line value ------ is expressed as the end of the quarter (see formula in the expression field

Hope this helps!

Not applicable
Author

Hi,

You have to adapt the formula.

When I ask yours dimensions it's because I need to know fields names IN the group.

=If (GetCurrentField("Calendar") = 'week', week(QuarterEnd(makedate(cYear,2,15)))+1)

Please, Could you send you application. I will built the formula and give you back it.