Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
GauravKumar1
New Contributor II

VENDOR CODE EXISTS IN CONTINUES THREE MONTH

Dear Team,

I Stuck a requirement.i want to check vendor code exists in continues three months.

Requirement is what

If my vendor code come in continues three month then it show consistent otherwise inconsistent.

Means vendor code 101 if come in apr, may, jun then consistent if this code miss any one month like may then it non consistent

 

 

 

Tags (1)
Labels (1)
1 Reply
Partner
Partner

Re: VENDOR CODE EXISTS IN CONTINUES THREE MONTH

Hi Gaurav,

 

Do the following:

Use the expression: if(count({<Year_Month,Date_Num={">=$(=Num(AddMonths(Max(Date_Num),-2)))<=$(=Max(Date_Num))"}>}Vendor)=3,'Consistent','Inconsistent')

in a chart, using only the vendor code as dimension.

 

This will count when the code is used in the last three months and if it's equal to 3, its consistent, since it counts the vendor code for the past last three months.

If not, it excludes the vendor.

 

As example, it gives the following for the bellow load script:

sample.png 

 

Load script is as follows:

dummy:
Load
*,
Num(Year_Month) as Date_Num;
Load
Vendor,
Date#(Month,'YYYY-MM') as Year_Month;
Load * Inline
[
Vendor,Month
A,2018-10
A,2018-11
A,2018-12
A,2019-01
B,2018-10
B,2019-01
];

 

And attached the app i used.