Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
Hi,
It is based on the Conditional check box under Expression tab of chart properties, refer to the attached screen shot.
Thanks Gowri Shankar.
Could u please explain how that condition works
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.
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.
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.
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"
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
Could you please explain the expression
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?