Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help on chart table expression

Hi all,

I am trying to convert label array into new table. I've got all values in each label and they OK, but when I am trying to put same label expression into table QlikView executes only first value and other ones ignored. How can I force executing all conditions in expression?

My Dimension expression:

=ValueList( Dual('Previous',1),  Dual('Current',2),  Dual('Change',3))

Expression value:

=pick(match(

  ValueList( Dual('Previous',1),  Dual('Current',2),  Dual('Change',3))

  , Dual('Previous',1)

  , Dual('Current',2)

  , Dual('Change',3)

  )

, // PREVIOUS

Sum({1}IF(Aggr(Count(

  {1<[Member Purchasing Group]={"$(=GetFieldSelections([Purchasing Group]))"}

  , [Posting Date] = {">=$(=$(vSelPreviousStartDate))<$(=$(vSelPreviousEndDate))"}

  , FrameTransCount = {1}>}

  DISTINCT [Framework Description]),[Member Code])=1, 1))

, // CURRENT

Sum({1}IF(Aggr(Count(

  {1<[Member Purchasing Group]={"$(=GetFieldSelections([Purchasing Group]))"}

  , [Posting Date] = {">=$(=$(vSelCurrentStartDate))<$(=$(vSelCurrentEndDate))"}

  , FrameTransCount = {1}>}

  DISTINCT [Framework Description]),[Member Code])=1, 1))

, // CHANGE / DIFFERENCE

//CURRENT

Sum({1}IF(Aggr(Count(

  {1<[Member Purchasing Group]={"$(=GetFieldSelections([Purchasing Group]))"}

  , [Posting Date] = {">=$(=$(vSelCurrentStartDate))<$(=$(vSelCurrentEndDate))"}

  , FrameTransCount = {1}>}

  DISTINCT [Framework Description]),[Member Code])=1, 1))

- // PREVIOUS

Sum({1}IF(Aggr(Count(

  {1<[Member Purchasing Group]={"$(=GetFieldSelections([Purchasing Group]))"}

  , [Posting Date] = {">=$(=$(vSelPreviousStartDate))<$(=$(vSelPreviousEndDate))"}

  , FrameTransCount = {1}>}

  DISTINCT [Framework Description]),[Member Code])=1, 1))

)

This should return data into 3 different columns: Previous, Current and Change values. Currently it returns only first Previous column. Moving part of expression into label value is displayed correctly. Also I will have to duplicate this formula 10 times as this returns only for framework count 1, then I will need to have 2 and etc up to 10 by changing single numeric value from

DISTINCT [Framework Description]),[Member Code])=1, 1))

to

DISTINCT [Framework Description]),[Member Code])=2, 1))

Also tried this using IF statement and did not worked too.

Is it possible to combine all this into single expression maybe?

My current results looks like this and contains only Previous values:

PreviousCurrentChange
PeriodsApr 2013  to Nov 2013Apr 2014  to Nov 2014
Trading on 1 framework24800
Trading on 2 frameworks12300
Trading on 3 frameworks9300
Trading on 4 frameworks7700
Trading on 5 frameworks3500
Trading on 6 frameworks3600
Trading on 7 frameworks900
Trading on 8 frameworks700
Trading on 9 frameworks200
Trading on 10 or more frameworks000

Thanks in advance.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

Can you post a .qvw document that demonstrates the problem?


talk is cheap, supply exceeds demand
Not applicable
Author

I can't put original file as too big. I'll maybe try to create a new one and then post it.

Not applicable
Author

Hi, I've create a simple example,

Added approx. data and created a red table. Trading members on 1 framework previous has 11 members, but current has 0 as well as changed.

I've moved same logic into labels below table for same row and they are displaying correctly.

Also I've tried to use different approach with blue table but I get wrong results. Did not checked on sample but I am sure the label values are correct as I get same in my live version.

Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

I found a small issue with single query 10 plus. It does not return correct values. I've added new parameter to pass number for testing on any numbers. As test used trading on 4 and more frameworks and returns 0 values but should return 1 as there is single member currently trading in on 5 frameworks.

Same happens with 10 plus. See attachment with red line.

Gysbert_Wassenaar

I found a small issue with single query 10 plus. It does not return correct values.

You changed the expression in the variable to accept a third parameter. The way you did that is almost, but not quite correct. Try this expression instead:

count({1< [Member Code]={'=Count(

  {1<[Member Purchasing Group]={"$(=only([Purchasing Group]))"}

  , [Posting Date] = {">=$(=$($1))<$(=$($2))"}

  , FrameTransCount = {1}>}

  DISTINCT [Framework Description])>=$3'}>} distinct [Member Code] )


talk is cheap, supply exceeds demand