Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

tauceef9
Contributor

How to filter data based on hardcoded filter

Hello Everyone,

I have a requirement wherein I have to create a Hardcoded filter like below:

ValueList('A','B','C')

And as per the value selected by user in the above filter I have to modify the data of a particular table (not the overall application).

Please suggest if there's any way of doing this.

Qliksense Version: QS Desktop June

Regards,

Tauceef

1 Solution

Accepted Solutions
MVP
MVP

Re: How to filter data based on hardcoded filter

A ValueList() is not a field, and it only has any meaning inside the object in which it is defined. So you can reference the ValueList from a dimension in an expression in the same object, but there is no way to select a value or to retrieve the selected value from another object, a macro or the load script.

It sounds like you need an island table - one that is not associated with any other table. Something like

ValueIsland:

LOAD * Inline

[   

     island_Value

     A

     B

     C

];

Now use the fields island_Value instead of the ValueList()

4 Replies
jaumecf23
Contributor III

Re: How to filter data based on hardcoded filter

Try something like this:

if(ValueList('A','B','C')='A', formula A',

     if(ValueList('A','B','C'))='B', formula B', formula C'))

tauceef9
Contributor

Re: How to filter data based on hardcoded filter

Hi Jaume,

Thanks for your response.

I tried this code but it is not working for me. As mentioned earlier we have created the hardcoded filter which is not linked with my data anywhere.

Is there a way we can get the selected value of a particular filter in sense? so that will use it in my formula to do the calculations.

I found one function "GetFieldSelections(dimention)" but this will not work in my case as I have created this filter using Listvalue() function.


Looking forward for a work around.

Edited:

Just found one more thing, which is bad again.

I have created the filter using Valuelist() function but when I select anything, no filter is getting applied.

Now I think I have to start asking from one step backword:

1. how to create a hardcoded filter with some values.

2. how we can use this filter in any chart or table to filter data.

Regards,

Tauceef

MVP
MVP

Re: How to filter data based on hardcoded filter

A ValueList() is not a field, and it only has any meaning inside the object in which it is defined. So you can reference the ValueList from a dimension in an expression in the same object, but there is no way to select a value or to retrieve the selected value from another object, a macro or the load script.

It sounds like you need an island table - one that is not associated with any other table. Something like

ValueIsland:

LOAD * Inline

[   

     island_Value

     A

     B

     C

];

Now use the fields island_Value instead of the ValueList()

tauceef9
Contributor

Re: How to filter data based on hardcoded filter

Thanks Jonathan, it works perfectly for me.

Regards,

Tauceef