Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
manideep78
Valued Contributor

Dynamic value in variable

Dear Community,

I want to get the value dynamically in a variable based on a condition.

 

KvValue
2163.7
229.92
235.84
244.6
254.03
3195.7
3213.4
337.51
345.74
354.93

The condition is like if K=2 and v=1 then 63.7.

like this i have to get the value stored in the variable based on a condition.

above table is a sample table. The original table consists of 1000 records. I have to look at all the conditions and then get the value in the variable.

Please let me know how can we achieve this.

Thanks in advance.

Regards,

Manideep

1 Solution

Accepted Solutions

Re: Dynamic value in variable

If Item and Category are fields then may be this:

=Only({<K = {"$(=Count(DISTINCT ITEM))"}, v= {"$(=Count(DISTINCT Customers))"}>}Value)

7 Replies
vardhancse
Valued Contributor III

Re: Dynamic value in variable

Hi,

even though the data is more we can maintain separate condition for each one dimension/expression.

so while creating the variable, add the condition and create different variables.

or

Attach a sample QVW, so that we can understand easily.

Re: Dynamic value in variable

May be this:

vVar: =Only({<K = {"$(=Concat(DISTINCT K))"}, v= {"$(=Concat(DISTINCT v))"}>}Value) or

vVar: =Only({<K = {"$(=GetFieldSelections(K))"}, v= {"$(=GetFieldSelections(v))"}>}Value)


Based on your selection in K and v list box, the value of vVar will change

manideep78
Valued Contributor

Re: Dynamic value in variable

Hi

Here I need to compare expression values with K and V.

K -  count(DISTINCT ITEM)

V- Count(DISTINCT Customers)

so, if( K = count(DISTINCT ITEM) and V= Count(DISTINCT Customers), Value)

             k =2 and V=3, then 5.84

Note: I don't have ITEM and Customers as filters. I do not want to add those filters.

Re: Dynamic value in variable

If Item and Category are fields then may be this:

=Only({<K = {"$(=Count(DISTINCT ITEM))"}, v= {"$(=Count(DISTINCT Customers))"}>}Value)

manideep78
Valued Contributor

Re: Dynamic value in variable

I tired, but no luck

sasiparupudi1
Honored Contributor III

Re: Dynamic value in variable

Please post your application

manideep78
Valued Contributor

Re: Dynamic value in variable

got it. Thanks sunindia