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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Self Servicing Charts

Hi,

I have attached a QVW that has a self servicing chart. Its a Straight table, on selecting a dimension it displays all the measures and selected dimension.

Please someone explain how its created. 

Thanks in advance

Keerthi

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Well,

=If( SubStringCount(Concat(_dimension, '|'), 'Sub Category'),If(SubStringCount(Concat(_dimension, '|'), 'Category')>1,1,0), SubStringCount(Concat(_dimension, '|'), 'Category'))

The section in RED - checks if the 'Sub Category' is there in selection, If TRUE, then it checks the PINK section - if 'Category' sub-string count is more than 1 (because, if you select only 'Sub Category' then it returns substring count 1 and you don't want to show 'Category' then) that means you have selected 'Category' as well as 'Sub Category'. In this case you set the condition true to display 'Category', otherwise FALSE.

The last section comes when 'Sub Category' is not selected (In ELSE part of RED section). Then it checks if only 'Category' is selected or not.

Hope this helps and makes sense.

View solution in original post

13 Replies
Not applicable
Author

Hi,

It is based on the Conditional check box under Expression tab of chart properties, refer to the attached screen shot.

Not applicable
Author

Thanks Gowri Shankar.

Could u please explain how that condition works

tresB
Champion III
Champion III

Expressions and Dimensions both are displayed conditionally. If you select a dimension say ''Region'' from the field _dimension, then the condition :=SubStringCount(Concat(_dimension, '|'), 'Region') returns 1 (non zero) and it turns the condition TRUE for that dimension and it gets displayed. Similarly for expressions.

Not applicable
Author

Thanks a lot tresesco

But in my application when i select a " Sub Category" dimension. Data can be seen for both "Category " and  " Sub Category "

Is There any mistake in the condition.

tresB
Champion III
Champion III

It would happen so, because 'Category' is a sub string of 'Sub Category'. Let me try a different condition and get back.

Update: By the time let me suggest you an alternative; RENAME 'Category' to '_Category' in the script and change the conditional expression accordingly.

Not applicable
Author

After changing to _category its working.

This is not happening for "Calendar Quarter" and "Calendar Year" since Calendar is common in both. This is happening only in case of "Category" and "Sub Category"

tresB
Champion III
Champion III

Got it !

Use expression for 'Category' :

=If( SubStringCount(Concat(_dimension, '|'), 'Sub Category'),If(SubStringCount(Concat(_dimension, '|'), 'Category')>1,1,0), SubStringCount(Concat(_dimension, '|'), 'Category'))

PFA

Not applicable
Author

Could you please explain the expression

tresB
Champion III
Champion III

Hello Keerthi,

Among "Calendar Quarter" and "Calendar Year" , none of them is a sub-string to another. But it 'Category' IS a sb-string to 'Sub Category'. Isn't it so?