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: 
jubarrosor
Partner Ambassador
Partner Ambassador

Use a variable as dimension

Hello,

I'm trying to create a bubble chart.

I need to use an expression as dimension and I created a variable for it. QV says that there is an error but my expression it's good because I'm using it in other charts:

The expression is:

mFinishedWithoutDelay =

count( {$<[Status] = P({1<[group]={'FINISHED'}>}[Description]),

                                          [delay_id]={'1'}>} DISTINCT request_id )

and the error is:

     Error: Garbage after expression: "FINISHED"

What is the problem?

Thank you and sorry for my english.

Best regards!.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

That expression will return only one value if you don't aggregate over dimensions. So it does not make sense to use it as a calculated dimension. How are you using it anyway: =mFinishedWithoutDelay or =$(mFinishedWithoutDelay) ?


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

That expression will return only one value if you don't aggregate over dimensions. So it does not make sense to use it as a calculated dimension. How are you using it anyway: =mFinishedWithoutDelay or =$(mFinishedWithoutDelay) ?


talk is cheap, supply exceeds demand
jubarrosor
Partner Ambassador
Partner Ambassador
Author

Hi Gysbert Wassenaar,

it's not the only dimension that i'm using (I'm using other twice)

I'm using =$(mFinishedWithoutDelay)

Thank you!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Can you post an example document that demonstrates the problem?


talk is cheap, supply exceeds demand
tresesco
MVP
MVP

If by any chance, you are using single quotes while defining variable, like:

mFinishedWithoutDelay = '<Your expression>'

Then, you might try with double quotes within set analysis like:

='count( {$<[Status] = P({1<[group]={"FINISHED"}>}[Description]),

                                          [delay_id]={1}>} DISTINCT request_id )'

jubarrosor
Partner Ambassador
Partner Ambassador
Author

Hi,

finally I resolved the problem using aggr.

I've used the expression aggr($(mFinishedWithoutDelay), Office)

Thank you very much!

Best Regards!