Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Referencing Set Analysis from a variable

Hi,

I have an expression Count({<[Student Id]=, [Location]=, [State]=> [Transcript Completion]} that returns me a count.

Now, I want to store the set analysis used in the above expression in a variable and reference the variable in the count expression. How do I do it?

Thanks,

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

Check out the following link if it helps you?

Qlikview Parameterised Variables

View solution in original post

12 Replies
swuehl
MVP
MVP

In your script:

LET  vSet = '{<[Student Id]=, [Location]=, [State]=>}';

or in the variable overview create the variable and assign the set analysis part (without single quotes):

{<[Student Id]=, [Location]=, [State]=>}


Then in your expression, use dollar sign expansion:


=Count( $(vSet) [Transcript Complete])


The Magic of Dollar Expansions

Not applicable
Author

I tried this approach, =Count( $(vSet) [Transcript Complete]) , but the dimension of [Transcript Complete] is not getting resolved.

swuehl
MVP
MVP

Sorry, I don't get what you mean.

Are you talking about the syntax checker in the expression dialog? Don't worry if there is a red wiggly line, the syntax checker is not able to understand the dollar sign expansion correctly.

It should still work though, just test it.

Not applicable
Author

Yes, I am talking about the red wiggly line in the expression dialog. I tried it but I get an "Error in Expression"

swuehl
MVP
MVP

Could you post a small sample QVW, or screenshots of your original working expression and then from the variable overview and the expression dialog using the variable?

petter
MVP
MVP

The red wiggly line is just because the expression parser in QlikView doesn't know how to check the expression correctly when it has a $-sign expansion. It will work anyway - just check that you get values in the column in the chart...

sasiparupudi1
Master III
Master III

Check out the following link if it helps you?

Qlikview Parameterised Variables

View solution in original post

Not applicable
Author

Hi there,

this is the part in my script that creates the set analysis part:

Let vCurrentCycle = Peek('Cycle Calendar Period',0,'Cycles');

Let vPrevMonthCycle = vCurrentCycle-1;

let vPrevYearCycle = vCurrentCycle-100;

Let vEFT_VOL_CP = '{<[Cycle Calendar Period]={$(vCurrentCycle)}>}';

Let vEFT_VOL_PP = '{<[Cycle Calendar Period]={$(vPrevYearCycle)}>}';

Let vEFT_VOL_CP = '{<[Cycle Calendar Period]={$(vPrevMonthCycle)}>}';

in my equation i'm trying this:

=sum({$<'$(vEFT_VOL_CP) '>} [EFT Volume] ), i have also tried your method (which returns an error), and this one returns an incorrect value, what is it i'm doing wrong.

Anil_Babu_Samineni

Question answered, You may create another thread by ref of this thread number

For your question, May be this? I've removed the single colon for variable. Don't worry about error in expression on top. Because you are creating single variable only not helping of any field. It will work

=sum({$<$(vEFT_VOL_CP)>} [EFT Volume] )

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)