Jump to content

Cross Table: Property control in combination with Case when and Nest


Vincent Verhoef

Recommended Posts

Hi all,

I am trying to create a custom expression for a cross table to have see Mutiple vertical columns at once. When I check the custom expression of a situation where you manually add vertical columns, the custom expression is as follows:

<[Column A] NEST [Column B]

I tried to implement this logic within a case when statement using a property control:

<Case

when "${Property1}" = "ColumnA" then [ColumnA]

when "${Property1}" = "ColumnB" then ([ColumnB] NEST [ColumnC])

end as [${Property1}]>

The first line with 'ColumnA' works fine, however when I try to nest column B with C I get an error like: image.png.2199789eea049109cf06b5424d529a64.pngWhat am I doing wrong, or how should I setup the custom expression to make this work?

Thanks in advance!

Link to comment
Share on other sites

Thanks for your reaction Kirsten. Your proposed solution however does not work and raises the following error:

image.png.35af311a9f3d7fc2bfcbda9b5ac891d3.pngUsed code:

<Case

when "${Property1}" = "ColumnA" then [ColumnA]

when "${Property1}" = "ColumnB" then (<[ColumnB] NEST [ColumnC]>)

end as [${Property1}]>

What would the correct syntax be?

Thanks in advance

Link to comment
Share on other sites

It turns out that 'NEST' is a top-level function, so it cannot be used in a case() statement. What I would suggest is that you create a property control with 'Set property value through' set to "Expressions". Then you can create all of the different expressions you want in your cross table, and even set the Display name to the desired option.

Link to comment
Share on other sites

Hi Kirsten,

Thanks again for your reaction, but again I cannot get this setup to work.

I added the property expression as follows:

Name | Expression

Column A | [Column A]

Column B | <[ColumnB] NEST [ColumnC]>

And on the vertical axis of the cross table I implemented this code to work with the property:

<${ZZZProp2}>

This results in the same errors as I have shown earlier.image.png.537a693fbe40cbc2c67839b1ddebd70f.pngAm I doing something wrong? Looking forward to your answer.

Link to comment
Share on other sites

Hi Gaia, thanks for your answer! But isn't this solution exactly what I described above?

I embedded the expressions directly as the values in the following way:

Display Name Expression

Column A | [Column A]

Column B | <[ColumnB] NEST [ColumnC]>

Then, within the cross table I used <${Property}> to call the property. The function seems to work for the expression of 'Column A', where the table shows the expected column. The 'Column B' expression results in the following error:

image.png.1abe7df508d2fbc9da2b4f5b39bc08ad.png 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...