Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Only Function

Hello all,

I am trying to work out an Only function with the use of some variables instead of fields

the idea is to get the population when one selects the city and the age group

the fields are

City, <14, 15-24, 25-34, etc

and the variables are vCity and vAge,

so the user selects the city and the age group and they should get the population as a result of this function:

only({<City=vCity>} vAge), apparently this is not correct,

thanx!

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attached File.

     Hope this is what you were trying to achieve.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

10 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

     only(Population)

     But only will work only when you have only one value for selection.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

thank you for the feedback, but I am a bit confused,

you see the fields  are

City, <14, 15-24, 25-34, etc

and the variables are vCity and vAge,

I have to select the City ( the row via the vCity variance) and the age group (the column via the vAge variance) to get the correct value which is the population.

Am I too confusing?

thank you

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Kindly post your qvw file. That will be helpful to me in understanding your problem.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

hi, here it is

thank you!

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attached File.

     Hope this is what you were trying to achieve.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thank you for the hint! very helpful,

I guess ONLY does not work with variables? or I should try approaching it otherwise?

Best regards

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     It can work.

     Have a look at the attached file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

I see, I have to make the crosstable either way.

again, thank you

swuehl
MVP
MVP

Using the CROSSTABLE is probably the more QV way of doing it, selecting in fields instead of using variables to analyze your data.

But just as a note, you can do it like you initially tried:

=only({<CITY= {$(vCITY)} >} [$(vAGE)] )