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: 
Not applicable

Annualized Sales for different customers in set analysis

Dear QV Experts,

YTD Sales for the customers will be calculated based on the Max(SalesDate) for different customer.

But Annualized Sales, Each customers having different Max(SalesDate).

Based on that, we have to calculate,

Please find the expression below,

Here Column(1) is YTD Sales,

DayNumberofYear(CYMaxDate) will return 65 days, if 05th March 2015

DayNumberofYear(CYEndDate) will return 365 days.

=num(( Column(1) / DayNumberOfYear(CYMaxDate))*DayNumberOfYear(CYEndDate),'$#,##0.00')


MaxSalesDateCustomer:

Select CustId, Max(Last_Reported) as PYMaxDateNew

FROM Sales

Group by CustId;

Here in this table, For every customers i received Maximum Sales Date.

Now i have to apply SetAnalysis in the expression below to take different dates instead of CYMaxDate.

=num(( Column(1) / DayNumberOfYear(CYMaxDate))*DayNumberOfYear(CYEndDate),'$#,##0.00')


Can anyone please suggest me?


Appreciate your prompt response.

Thanks,

Sasi

1 Reply
maxgro
MVP
MVP

Better if you post a small .qvw

I think you can calc with set analysis the YTD and then multiply by

DayNumberOfYear(CYMaxDate))*DayNumberOfYear(CYEndDate)

something like

sum({$ <datefield={">=$(=MakeDate(Year(Today()))) <=$(=(Today()))"}>} Sales)

*

DayNumberOfYear(Today()) / DayNumberOfYear(MakeDate(Year(Today()),12,31))