Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis New Customers

Hi All,

I have a requirement to find out sales of only new customers in a specific period. Could you please help me out with set analysis expression. I have attached the sample.

For the period Jan count should be 2, Feb 1, mar 2

Thanks,

Mc

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this expressions

Jan : =Sum({$<ODate={">=2014-01-01<=2014-01-31"}>} Aggr(If(MonthName(Min(TOTAL <sCustomer> ODate)) = MonthName(ODate), Sum(sSales)), sCustomer, ODate))

Feb: =Sum({$<ODate={">=2014-02-01<=2014-02-28"}>} Aggr(If(MonthName(Min(TOTAL <sCustomer> ODate)) = MonthName(ODate), Sum(sSales)), sCustomer, ODate))

Mar: =Sum({$<ODate={">=2014-03-01<=2014-03-31"}>} Aggr(If(MonthName(Min(TOTAL <sCustomer> ODate)) = MonthName(ODate), Sum(sSales)), sCustomer, ODate))

Regards,

Jagan.

View solution in original post

3 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Arrive a flag in script for new customers and use it in set analysis, please find attached file for solution.

Regards,

Jagan.

Not applicable
Author

Thanks Jagan. I don't want to modify the script now as I have a complex model. Isn't it possible to do directly from front end?

Thanks,

mc

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this expressions

Jan : =Sum({$<ODate={">=2014-01-01<=2014-01-31"}>} Aggr(If(MonthName(Min(TOTAL <sCustomer> ODate)) = MonthName(ODate), Sum(sSales)), sCustomer, ODate))

Feb: =Sum({$<ODate={">=2014-02-01<=2014-02-28"}>} Aggr(If(MonthName(Min(TOTAL <sCustomer> ODate)) = MonthName(ODate), Sum(sSales)), sCustomer, ODate))

Mar: =Sum({$<ODate={">=2014-03-01<=2014-03-31"}>} Aggr(If(MonthName(Min(TOTAL <sCustomer> ODate)) = MonthName(ODate), Sum(sSales)), sCustomer, ODate))

Regards,

Jagan.