Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hide Columns in Straight Table depending on Cycle Group

Hi all,

I have a straight table and want to replace/hide the columns in case my cycle box gets a new value.


Example:

My cycle box contains bike and car. In case i choose car i want different columns shown with the car attributes. In case i choose bike the car columns shouldn't be shown and be replaced by the different bike columns.

I tried to set up the conditional for columns under presentation but it doesn't worked!

Many thanks,

Harry

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Use the getcurrentfield function to retrieve the name active field in the cylce group. You can use this in the conditional expression. For example =if(getcurrentfield(MyCyclicGroup)='car',1,0) for the fields that should be shown when car is the active field in the cycle group MyCyclicGroup


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks! I tried the following and it doesn't work:

=IF(GetCurrentField('MyCycleBox')='bike',if(aggr(rank(sum(bike.sales)),bike.sales)<=10,bike.sales),NULL())

Could you give me a short example .qvw which is working with your solution?

Many Thanks,

Harry

JonnyPoole
Former Employee
Former Employee

Try using square brackets instead:

=IF(GetCurrentField([MyCycleBox])='bike',if(aggr(rank(sum(bike.sales)),bike.sales)<=10,bike.sales),NULL())

JonnyPoole
Former Employee
Former Employee

attached is an example

i think square brackets is the issue, but the remaining syntax in your expression may yield other issues, if it doesn't work, make it a real simple expression and then add to the expression incrementally (testing each time) until you get it doing the aggr() , rank() etc... the way you want.

Not applicable
Author

Many thanks Jonathan!

Your example is working great and I solved my problem!

Many thanks again,

Harry