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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
avastani
Partner - Creator III
Partner - Creator III

How to Obtain Chart Type information in an expression?

Has anyone tried to obtain the chart type in an expression.

I want to use 1 expression if it is a straight table and another expression if it is a pivot table in the same object using the fast change.

thanks in advance for your help.

3 Replies
Not applicable

Hello Amir

There's no function to get the chart type but you might be able to do what you want using the function secondarydimensionality().
From the helpfile: "The secondarydimensionality() function always returns 0 when used outside of pivot tables.

So, in your expression, you could write: if(secondarydimensionality()=0, straighTableExpr, pivotTableExpr)

Haven't tested it but it should work.

/Fredrik

avastani
Partner - Creator III
Partner - Creator III
Author

Hi Fredrik,

That works, thanks! But now let me add a little complexity curve to it. How about I would like to view the same as a YTD, PYTD, Variance for rolling averages?

i.e. the expression is rangesum(before(sum(salesamount), 0, 3))

the before function fails because it isn't a trend table anymore but more so, the pivot table is just plain blank despite using secondarydimensionality()

any ideas? thanks again.

Not applicable

Hi

I don't quite follow you. Can you post an example application?

/Fredrik