Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fast Change

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

1 Solution

Accepted Solutions
m2r4miller
Contributor III
Contributor III

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

View solution in original post

23 Replies
Gysbert_Wassenaar

Try adding an extra character like a @ to the values:

=SubStringCount(Concat(Dimension & '@', '|'), 'Underwriter@')


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert.

But it looks odd in the front end displaying Underwriter@

Not applicable
Author

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.

Not applicable
Author

I tried this but nothing has changed

jagan
Luminary Alumni
Luminary Alumni

HI,

Check this link hope it helps you.

Adhoc reporting in Qlikview

Regards,

Jagan.

Not applicable
Author

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Use expression like this

=SubStringCount('|' & Concat(distinct Dimension, '|') & '|', '|underwriter |')

=SubStringCount('|' & Concat(distinct Dimension, '|') & '|', '|Underwriter to Sector|')

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi,

I use space in front, check attached app, it may help you

Regards

NR

stabben23
Partner - Master
Partner - Master

Hi,

try to put a doublequote around your dimensions in the inline table: "Underwriter To Sector" ex

//Staffan