Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have created an Inline function
Load * Inline [
Dimension
Underwriter
Underwriter To Sector
Trade Sector
SecToUnd
];
I am using this in a chart conditionally. When i select Underwriter, dimension of the chart should be Underwriter.
When i select 'Underwriter to Sector' it should select a drill down dimension i.e 'Underwriter to Sector'
I have used =SubStringCount(Concat(Dimension, '|'), 'Underwriter') for Underwriter
and =SubStringCount(Concat(Dimension, '|'), 'Underwriter to Sector') for Underwriter to Sector.
But its not coming properly. I know the reason this is because of the substringcount considers underwriter in both the cases.
Please help me how to solve this.
I have attached the QVW. Please look into it.
Thanks in advance,
Keerthi
I ran into the exact same problem. Instead of this code: =SubStringCount(Concat(Dimension, '|'), 'Underwriter'), you could use this code instead for your conditional expression:
GetFieldSelections(Dimension) = 'ALL' or
Index(GetFieldSelections(Dimension, '|'), 'Underwriter') > 0
The GetFieldSelections(Dimension, '|') function will build a list of bar separated selections from the Dimension field with one caveat - when EVERY field is selected in Dimension, GetFieldSelections(Dimension) returns 'ALL'.
If you still run into selections like 'Underwriter' and 'Underwriter to Sector' not working because 'Underwriter' appears in both, you can work around this by changing one of the values slightly, remembering that QlikView is case-sensitive which means 'UnderWriter' or 'Under writer' is not the same as 'Underwriter'.
In my case, I had 'Age' and 'Age Group' as dimensions, and selecting 'Age Group' also caused 'Age' to display - I overcame it by changing 'Age' to 'AGE' - problem solved.
You may also want to add a Calculation Condition on the General tab of the chart similar to this:
GetSelectedCount(Dimension) > 0 to prevent the chart from displaying when no dimensions are chosen.
-Mark
Try adding an extra character like a @ to the values:
=SubStringCount(Concat(Dimension & '@', '|'), 'Underwriter@')
Thanks Gysbert.
But it looks odd in the front end displaying Underwriter@
Hi Gybert,
I am trying this script but Output Not exactly,
Dev01:
Load * Inline
[
Dimension
Underwriter
Underwriter To Sector
Trade Sector
SecToUnd
];
LOAD SubStringCount(Concat(Dimension & '@', '|'), 'Underwriter') as Underwriter Resident Dev01;
load SubStringCount(Concat(Dimension & '@', '|'), 'Underwriter To Sector') as Underwriter_To_Sector Resident Dev01;
Regards,
Raja.
I tried this but nothing has changed
Hi Jagan,
Problem is when i have sub string names common. Here one is underwriter and Underwriter to Sector.
When i select underwriter to sector. Underwriter dimension is selected twice.
This should not happen
Thanks & regards,
Keerthi
Hi,
Use expression like this
=SubStringCount('|' & Concat(distinct Dimension, '|') & '|', '|underwriter |')
=SubStringCount('|' & Concat(distinct Dimension, '|') & '|', '|Underwriter to Sector|')
Hope this helps you.
Regards,
Jagan.
Hi,
I use space in front, check attached app, it may help you
Regards
NR
Hi,
try to put a doublequote around your dimensions in the inline table: "Underwriter To Sector" ex
//Staffan