Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
caltmag22
Contributor III
Contributor III

RangeSum() and Peek() -> Not working in Data Load Editor

This is my script:

 

Daily_Population:
LOAD

monthname([date_signed]) AS [Month Year],
Count(DISTINCT [PlayerI_D]) as CountofPlayers,
RangeSum(Count(DISTINCT [Player_ID]),peek(CumulativeCountofPlayers)) as CumulativeCountofPlayers

RESIDENT [alpha_fact_client_info]
GROUP BY monthname([date_signed]);

 

My end goal is something like this:

Month | Population | Total Population (Running)

Jan 2022 | 10 | 10

Feb 2022 | 5 | 15

Mar 2022 | 30 | 45

Apr 2022 | 50 | 95

 

It keeps throwing me an invalid expression error!

 

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

maybe this works for you?

Daily_Population:
LOAD *,
     RangeSum(CountofPlayers,Peek(CumulativeCountofPlayers)) as CumulativeCountofPlayers;
LOAD MonthName(date_signed) as [Month Year],
     Count(DISTINCT PlayerI_D) as CountofPlayers
RESIDENT [alpha_fact_client_info]
GROUP BY monthname([date_signed])
Order By date_signed;

 

View solution in original post

3 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

Just do it in two steps - at the first load aggregating the values and within a second sorted resident-load you cumulate the results with rangesum() + peek().

- Marcus

MarcoWedel

maybe this works for you?

Daily_Population:
LOAD *,
     RangeSum(CountofPlayers,Peek(CumulativeCountofPlayers)) as CumulativeCountofPlayers;
LOAD MonthName(date_signed) as [Month Year],
     Count(DISTINCT PlayerI_D) as CountofPlayers
RESIDENT [alpha_fact_client_info]
GROUP BY monthname([date_signed])
Order By date_signed;

 

caltmag22
Contributor III
Contributor III
Author

This worked! Thank you!