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: 
Not applicable

Calculated Dimension

Hi Guys,

I have read through a few posts regarding this and havent come across a solution pertaining to my exact problem. What I am trying to do is build some financial reporting. In one of the SQL tables there is a column called AccountGroupDescription. This column has entries like Cost of Sales, Turnover, Current Liabilities et cetera.

What I am trying to do is build a financial dashboard with 4 'fields' in the AccountGroupDescription. This needs to be a pivot table. So I have COS and Turnover, I want to add Gross Profit and Gross Margin % but they need to appear along with the above 2 in the dimension.

I hope my explaination of what I am looking for makes sense and someone knows how I could possible achieve this

Many thanks,

Byron

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi, Byron

Maybe you could create four expressions instead of a dimension

or

You can create those dimensions at script level

or

use valuelist as a dimension. This can create an artificial dimension, like this:

=valuelist('COS', 'TO', 'GP','GM')

Then, the expressions will need an if statement, like this:

= if( valuelist('COS', 'TO', 'GP','GM') ='COS',SUM( {<AccountGroupDescription = {COS}>} VALUE) ,

if ( valuelist('COS', 'TO', 'GP','GM') ='COS', etc...

Hope this helps,

Erich

View solution in original post

4 Replies
Not applicable
Author

Anyone??????

erichshiino
Partner - Master
Partner - Master

Hi, Byron

Maybe you could create four expressions instead of a dimension

or

You can create those dimensions at script level

or

use valuelist as a dimension. This can create an artificial dimension, like this:

=valuelist('COS', 'TO', 'GP','GM')

Then, the expressions will need an if statement, like this:

= if( valuelist('COS', 'TO', 'GP','GM') ='COS',SUM( {<AccountGroupDescription = {COS}>} VALUE) ,

if ( valuelist('COS', 'TO', 'GP','GM') ='COS', etc...

Hope this helps,

Erich

Not applicable
Author

Excuse my language, but you sir are a fucking legend. Thank you very much...Besides just solving my problem I can see many uses for this type of code

Many thanks man,

Byron

erichshiino
Partner - Master
Partner - Master

I'm glad I could help! I learnt about valuelist() a few weeks ago!

There are many interesting uses for this!!!

Regards,

Erich