Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

Showing dimensions dinamically in pivot table

Hi all,

PFA.

Can u plz tellme how to select dimensions dinamically in pivot table by using adhoc dimensions.

Plz tell me how it works.

Thanks

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Deepak,

Let's have a class. .

Concat(distinct Dimension, '|') -> will concat the distinct(single out of may appearances) values for each member( Bussiness Line, Application Name,Year ,...) of the field 'Dimension' along with extra character '|' to produce a string something like:  'Bussiness Line|Application Name|Year|.....'. Hence, the first parameter of SubSringCount - ''|' & Concat(distinct Dimension, '|') & '|' - >will add two '|' at the starting and closing of the string to produce: '|Bussiness Line|Application Name|Year|.....|'

Now, your expression has been reduced to something like: =SubStringCount('|Bussiness Line|Application Name|Year|.....|', '|Customer Name|')

Then what the SubStringCount does is -> It sees if there is any part of the string like '|Customer Name|' (as mentioned as the second parameter of the function). If it is there then it returns non-zero (position of the sting) which is eventually treated as TRUE.

So when would this condition turns to be true? Well, when you select that value from the Dimension field or nothing is selected at all (because that means all are under scope to be considered), the concat() gets it and produces the string with that value and SubStingCount() finds it and returns a non-zero. If not found, returns zero (FALSE). So this is how your dimension enablilty works conditionally. Hope it helps you comprehend.

View solution in original post

6 Replies
ashfaq_haseeb
Champion III
Champion III

Hi deepak

go through the below post.

http://community.qlik.com/docs/DOC-5404

Regards

ASHFAQ

deepakqlikview_123
Specialist
Specialist
Author

Hi All,

Can u plz tell me how

=SubStringCount('|' & Concat(distinct Dimension, '|') & '|', '|Customer Name|')

will work.

Thanks

Not applicable

Hi,

you can you something below in Condition...

=SubStringCount(Concat(CAL,'|'),'YEARS')

D_Pivot.PNG.png

ashfaq_haseeb
Champion III
Champion III

Hi

An example could be  Substringcount(concat(distinct '|' & MyDimension & '|'), '|ValueA|) will evaluate as true if ValueA is a possible value in MyDimension and false if it's not. So it can be used as a conditional expression to show/hide things depending on what values the user selected. The | characters are to make sure of an exact match.


Regards

ASHFAQ

tresesco
MVP
MVP

Deepak,

Let's have a class. .

Concat(distinct Dimension, '|') -> will concat the distinct(single out of may appearances) values for each member( Bussiness Line, Application Name,Year ,...) of the field 'Dimension' along with extra character '|' to produce a string something like:  'Bussiness Line|Application Name|Year|.....'. Hence, the first parameter of SubSringCount - ''|' & Concat(distinct Dimension, '|') & '|' - >will add two '|' at the starting and closing of the string to produce: '|Bussiness Line|Application Name|Year|.....|'

Now, your expression has been reduced to something like: =SubStringCount('|Bussiness Line|Application Name|Year|.....|', '|Customer Name|')

Then what the SubStringCount does is -> It sees if there is any part of the string like '|Customer Name|' (as mentioned as the second parameter of the function). If it is there then it returns non-zero (position of the sting) which is eventually treated as TRUE.

So when would this condition turns to be true? Well, when you select that value from the Dimension field or nothing is selected at all (because that means all are under scope to be considered), the concat() gets it and produces the string with that value and SubStingCount() finds it and returns a non-zero. If not found, returns zero (FALSE). So this is how your dimension enablilty works conditionally. Hope it helps you comprehend.

deepakqlikview_123
Specialist
Specialist
Author

Thanks