Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Valuelist unexpected behaviour

Hi Folks,

I defined a Pivot table with a calculated Dimension (a valuelist) and the behaviour is rather curious.

A short example:

2 Dimensions (Region and Product), 1 calculated Dimension (Valuelist('Week','Year')

one Expression: sum Sales

What I want to Display is Region vertical, Valuelist in upper horizontal and Product in lower horizontal

Expression is defined as: if Valuelist('Week','Year')='Week', sum(Sales), sum ({<Week={'<=$(=max(Week))'}Sales)

I want to Display sales of selected week and cumulative sales (from start of year to selected week)

Header 1RegionHeader 2Header 3Header 4Header 5
WeekWeekYearYear
Product 1Product 2Product 1Product 2
Region1102050100
Region 21001510075

Now what is curious:
Whenever a Region has no sales, the expression does not calculate the first condition (Week) but the second one

So by simply defining if Valuelist('Week','Year')='Week',1,2 I do see 2 when there is no sales for this product

In the above table Product1 is not sold in Region 2, so Week contains the same value as Year

I cannot upload a small sample as upload is forbidden at customer site

the formulas (just an example) above are working (as all data is correct for regions with sales)

Any idea???

1 Solution

Accepted Solutions
swuehl
MVP
MVP

15 Replies
swuehl
MVP
MVP

Have you also tried the same with a data island dimension created in the data model instead of ValueList()?

Anonymous
Not applicable
Author

not yet, should it be a better approach than valuelist?

Kushal_Chawda

try pick and match

Pick( match(Valuelist('Week','Year'),'Week','Year'),

sum(Sales), sum ({<Week={'<=$(=max(Week))'}Sales))

Anonymous
Not applicable
Author

now week data seems to be okay (Shows "-" when there is no data)

but year data is not correct, total shows correct value, but only 1 product shows

correct data while other products Show "-"

Kushal_Chawda

Would you be able to share sample?

Anonymous
Not applicable
Author

I will prepare a sample and upload it.

it may take a while

what i noticed with your pick method is  that i got Detail values for year onlyvfor

the product which alslo had sales in the week.

the total was correct in both cases

swuehl
MVP
MVP

Have you already tried the data island? I think it may help with your issue:

2016-06-01 21_50_01-QlikView x64 - [C__Users_Stefan_Downloads_comm219156.qvw_].png

Anonymous
Not applicable
Author

I attach example with both ways (Valuelist and Data Island).Please have a look to PROD3. In week 11 there is no sales for REG2. In the Pivot table we see the value for the year

Anonymous
Not applicable
Author

please see attached file

hope you find a solution