Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
annabergendal
Partner
Partner

Less than variable in set analysis

I have a problem in my set analysis, when trying to get all values prior to a period.

It works to include all values within this period:

count( {$<ÅrVecka={'$(vPreviousWeekYear)'}>}  distinct CustomerPortLabel)

But this returns zero:

count( {$<ÅrVecka = {'<= ${=vPreviousWeek}'}>} distinct CustomerPortLabel)

What am I doing wrong?

Thanks

9 Replies
rubenmarin

Not sure if it's a typo, try:

count( {$<ÅrVecka = {'<= $(=vPreviousWeek)'}>} distinct CustomerPortLabel)

ashfaq_haseeb

Hi,

Try like this

count( {$<ÅrVecka = {'<= ${=vPreviousWeek}'}>} distinct CustomerPortLabel)

or

count( {$<ÅrVecka = {"<= ${=vPreviousWeek}"}>} distinct CustomerPortLabel)


Regards

ASHFAQ

jonathandienst

Hi

The expression that works uses vPreviousWeekYear; the one that does not uses vPreviousWeek.


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
colin_albert

Try

     count( {$<ÅrVecka = {'<= $(vPreviousWeek)'} >} distinct CustomerPortLabel)

You should only need $(variablename) to evaluate the variable, not $(= variablename)

Not applicable

Hi,

Just remove { } and place the variable in ( )

count( {$<ÅrVecka = {'<= $(=vPreviousWeek)'}>} distinct CustomerPortLabel)

its_anandrjs

What is the definition of vPreviousWeek or you use wrong brackets like { } this remove it with ( ) for variable only

Count( {$<ÅrVecka = {'<= $( =vPreviousWeek )'}>} distinct CustomerPortLabel)


Or


Count( {$<ÅrVecka = {"<= $( =vPreviousWeek )"}>} distinct CustomerPortLabel)


Or


Count( {$<ÅrVecka = {'<= $( =Week(Today())-1 ) '}>} distinct CustomerPortLabel)


Regards

Anand

annabergendal
Partner
Partner
Author

You are right, I misspelled it, but they are both spelled vPreviousWeekYear in the app

annabergendal
Partner
Partner
Author

Thanks for all the advices, but none of these worked. I ended up using another syntax in the end with Date:

count( {$<Datum={"<$(=Date(weekstart($(vToday)),'YYYY-MM-DD'))"}>}  distinct CustomerPortLabel)

Don't ask me why this worked and the others did not... Some kind of syntax problem with the variable vPreviousWeekYear I guess, even though the other comparison worked.

ashfaq_haseeb

Hi,

Can you post sample to look over.

Regards

ASHFAQ