-
Re: Get New Customer and uneventful customers
Mark Little Nov 30, 2017 5:13 AM (in response to Gloria Bertini)Hi,
You could do in both the script and Set analysis.
Create flags for each season
So
Left join
LOAD
CodeCustomer,
1 as ThisSeasonFlag
RESIDENT STAGIONI_DI_ACQUISTO
WHERE CodeSeason = 'This Season' //What ever the code for this is
once you have a flag for each season just use set analysis like
COUNT({<ThisSeasonFlag={1},LastSeasonFlag-={1}>}CodeCustomer)
and so on.
You code always even build on the initial flags in script to mark the the New customer and eneventful customers
Mark
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 5:50 AM (in response to Mark Little )Hi Mark,
thanks a lot for answer,
the problem is that i have to do this for all the season beacause customer could select season of interest.
How can i do that ?
-
Re: Get New Customer and uneventful customers
Mark Little Nov 30, 2017 6:12 AM (in response to Gloria Bertini)Hi.
There will be a way of doing it, Might need to know a little more about the data to give an exact answer, but i would look to create a new table in the data.
This will have to link to back on Customer, season and you need to create a flag, to see if they ordered in this season.
Then you could use the Previous or Peek function to check if they order last season. Making sure it is ordered by customer and season, somthing like
IF(CodeCustomer=Peek('Codecustomer',-1),
PEEK('OrderedFlag',-1)
) AS OrderLastSeason.
Then each line of data will have a flag for order this season and last season, so will be dynamic to your season selections.
Mark
-
-
-
Re: Get New Customer and uneventful customers
Andrea Gigliotti Nov 30, 2017 5:49 AM (in response to Gloria Bertini)what you asking for should works based on the season currently selected ? I mean the current season is being choosen dynamically ?
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 5:51 AM (in response to Andrea Gigliotti )Yes, The choose is dynamic
-
Re: Get New Customer and uneventful customers
Andrea Gigliotti Nov 30, 2017 6:23 AM (in response to Gloria Bertini)let's try using the below expressions:
//for new customers:
=count( {< CodeCustomer = P( {< IndexSeason = {"$(=Concat( distinct IndexSeason,','))"} >} ) * E( {< IndexSeason = {">=$(=Concat( distinct IndexSeason,',')-2)<=$(=Concat( distinct IndexSeason,',')-1)"} >} ) >} distinct CodeCustomer )
//for uneventful customers:
=count( {< CodeCustomer = P( {< IndexSeason = {"$(=Concat( distinct IndexSeason,',')-1)"} >} ) * E( {< IndexSeason = {"$(=Concat( distinct IndexSeason,','))"} >} ) >} distinct CodeCustomer )
in this way the user can select the current season from a listbox.
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 6:41 AM (in response to Andrea Gigliotti )Thanks very much for answer but, there is problem, qlik don't recognize p() as a report function
-
Re: Get New Customer and uneventful customers
Andrea Gigliotti Nov 30, 2017 6:54 AM (in response to Gloria Bertini)could you post a screenshot to see the error ?
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 7:51 AM (in response to Andrea Gigliotti )-
Re: Get New Customer and uneventful customers
Andrea Gigliotti Nov 30, 2017 8:24 AM (in response to Gloria Bertini)yes I see it however what about the result you get ?
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 8:42 AM (in response to Andrea Gigliotti )The result is 0, and this is a screenshot of a pivot table with dimension season and measure: !
=count( {< CodiceCliente1 = P( {< IndiceStagione1 = {"$(=Concat( distinct IndiceStagione1,','))"} >} ) *
E( {< IndiceStagione1 = {">=$(=Concat( distinct IndiceStagione1,',')-2)<=$(=Concat( distinct IndiceStagione1,',')-1)"} >} ) >} distinct CodiceCliente1 )
-
Re: Get New Customer and uneventful customers
Andrea Gigliotti Nov 30, 2017 8:50 AM (in response to Gloria Bertini)for this to work you have to select only one value for season field.
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 8:58 AM (in response to Andrea Gigliotti )The result is always 0
-
Re: Get New Customer and uneventful customers
Andrea Gigliotti Nov 30, 2017 9:00 AM (in response to Gloria Bertini)at this point I can't help you further without a sample qvf file to work with.
-
Re: Get New Customer and uneventful customers
Gloria Bertini Nov 30, 2017 10:01 AM (in response to Andrea Gigliotti )Thanks the same,
unfortunately I can’t post qvf for privacy reasons.
I will try to fix the problem from the script.
-
-
-
-
-
-
-
-
-
-
-
-
Re: Get New Customer and uneventful customers
Gloria Bertini Dec 6, 2017 8:20 AM (in response to Gloria Bertini)I solved the problem using the solution proposed in this thread: set-analysis lost customers
Thanks all for help