Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
silviacico
Partner - Contributor II
Partner - Contributor II

RangeSum with ValueList()

Hello everybody,

I'm having some problems with the function ValueList() with a RangeSum(above(...)), in particular I'm using the ValueList in order to set colors in my bar chart.

The code is:

if(ValueList('New usersi','Existing users', 'Inactive')='New users'

  ,(count({$<result={'ok'}, flag={'Battesimo'}>} DISTINCT user_id2))

  ,if(ValueList('New users','Existing users', 'Inactive')='Existing users'

    ,(count({$<result={'ok'}, flag={'Totale giocate'}>} DISTINCT user_id2))- count({$<result={'ok'}, flag={'Battesimo'}>} DISTINCT user_id2)

      ,if (ValueList('New users','Existing users', 'Inactive')= 'Inactive'

        ,(rangesum(above(count({$<result={'ok'}, flag={'Battesimo'}>} DISTINCT user_id2),1,rowno()-1) )

  - (

              count({$<result={'ok'}, flag={'Totale giocate'}>} DISTINCT user_id2)

              -

              count({$<result={'ok'}, flag={'Battesimo'}>} DISTINCT user_id2)

            ) 

      ) 

    )

  )

)


With dimensions:

- Weekstart(link_date)

- ValueList('New users','Existing users', 'Inactive').



I tried the code without the ValueList (using 3 different measures and only "Weekstart(link_date)" as dimension) and it's working, however with the valuelist the measure in the third IF is not working.

Thank you




2 Replies
swuehl
MVP
MVP

Not exactely sure what you want to calculate.

But remember that Above() is limited to the column segment (without using TOTAL), so not sure how this is supposed to work given the ValueList() not really linked to your data model, thus returning the same record set for each dimensional value.

If you can post a small sample QVW and your expected results, maybe this helps to understand your issue.

silviacico
Partner - Contributor II
Partner - Contributor II
Author

Hi ,

that's an example of my problem, the second graph has to look like the first one, but the ValueList creates the issue.

Thanks,

Silvia