Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Problem with a diagram to display different data


Hi,

I have the following scenario:

- The set of data I've downloaded encompasses data for employees in all areas of the company.

- I want the diagram to display the data for different areas, depending on a variable (that should be possible using a set_expression)

- To enable the user to select an area and change the variable accordingly, I have made in the script two inline tables:

     - "Plant" with the (numeric) values 56, 64 and 74

     - "Area" with some (text) values

The formula I have for my variable is currently like this:

IF(((GetCurrentSelections(Werk) = 64) AND (TRIM(GetCurrentSelections(Bereich)) = 'Staplerstrg')), 'SS_64', 'ges')

=> When the user has made these two selections (the plant is a numeric value, I can see it in a multi_selection_box (the value is on the right)), I want the variable to hold the text 'SS_64'; Depending on that, I would then enter some more formulas in the diagram with a specific set_expression to filter my data.

Can anybody help me with that?

Thanks a lot!

Best regards,

DataNibbler

7 Replies
Not applicable

Hi

I'm a little confused what you are trying to do - can you share the qvw also?


Regards

Steve

datanibbler
Champion
Champion
Author

Hi Steve,

I don't have those formulas in yet, so the qvw in its current state would not tell you much.

What I want to do - I have done this already, but then I was loading data from an Excel report whereas now I am querying the database itself.

- There are several areas in our company for which I want to display presence_quotas.

- In the "old version", I was loading from an Excel report which had the figures for every one of those areas

  => The challenge then was merely which of them to display.

  => I solved this by adding several clones of the same formula in the diagram, each one of which would be displayed when a variable I had for the purpose had a specific value.

=> This variable was defined by user_selections in two different selection_boxes, connected by 'AND'.

=> I want to do the same now and the current step is merely getting the variable right. It's going to become much more complex, but once I have it working in a basic form, that will do. However, it doesn't work yet.

Best regards,

DataNibbler

Not applicable

Hi

I knocked something up briefly - see attached.  I think the issue was with the GetCurrentSelections, which seems to be returning all your selections (see top right box in example), thus as a piece of logic it fails.

I've replaced this in your formula with only - see the second box.  This seems to work.

Let me know how you get on and whether or not this is the correct answer.

Regards


Steve

datanibbler
Champion
Champion
Author

Hi Steve,

yes, this seems to work.

I'm slightly puzzled because Getcurrentselections() worked fine in the "old version" - but if it works, so much the better.

Thanks a lot!

Best regards,

DataNibbler

Gysbert_Wassenaar

Are you confusing getcurrentselections with getfieldselections? The getcurrentselections function doesn't accept field names as parameter.

Also if you select only one value you don't need the getfieldselections function. The only function will do:

IF(((only(Werk) = 64) AND (TRIM(only(Bereich)) = 'Staplerstrg')), 'SS_64', 'ges')


talk is cheap, supply exceeds demand
datanibbler
Champion
Champion
Author

That's it.

I was confusing the two.

Many thanks!

Best regards,

DataNibbler

Not applicable

No worries, glad I could help - I think that's my first correct answer!!

All the best.