Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting - addressing the gap

Hi Qlikviewers,

I need help on writing a statement which to show countries have data on 11/30/2013 but don't have data on 12/31/2013, a chart which only showing countries reported on 11/30/2013 and no data on 12/31/2013.

Here's the data and highlighted in blue are countries have no data on 12/31/2013. 

CountryDatefiled
Spain11/30/2013 0:00:0010
Indonesia11/30/2013 0:00:004
Indonesia12/31/2013 0:00:003
Germany11/30/2013 0:00:006
Guatemala11/30/2013 0:00:004
Guatemala12/31/2013 0:00:001
Philippines11/30/2013 0:00:003
Philippines12/31/2013 0:00:001
Peru12/31/2013 0:00:003
Honduras11/30/2013 0:00:003
Tanzania11/30/2013 0:00:002
Jamaica12/31/2013 0:00:002
Nicaragua11/30/2013 0:00:001
Nicaragua12/31/2013 0:00:001
Egypt11/30/2013 0:00:001
Egypt12/31/2013 0:00:001
Guam11/30/2013 0:00:002
Romania11/30/2013 0:00:002
Thailand12/31/2013 0:00:001
Bahrain12/31/2013 0:00:001
Israel11/30/2013 0:00:001
Greece12/31/2013 0:00:001
Puerto Rico12/31/2013 0:00:001
Nigeria11/30/2013 0:00:001

Thank you in advance for your help.


Have a great weekend.


Jasmine

1 Solution

Accepted Solutions
maxgro
MVP
MVP

you can use a chart with

dimension          Country

expression          if(count({$<[Date]={'11/30/2013'}>} Filed) >0 and count({$<[Date]={'12/31/2013'}>} Filed) =0, 'X')

CountryYes 11, No 12
GermanyX
GuamX
HondurasX
IsraelX
NigeriaX
RomaniaX
SpainX
TanzaniaX

View solution in original post

6 Replies
Not applicable
Author

try the following code

=If(Date='11/30/2013' and Data<> '-' and Date='11/31/2013' And Data='-',Country)

maxgro
MVP
MVP

you can use a chart with

dimension          Country

expression          if(count({$<[Date]={'11/30/2013'}>} Filed) >0 and count({$<[Date]={'12/31/2013'}>} Filed) =0, 'X')

CountryYes 11, No 12
GermanyX
GuamX
HondurasX
IsraelX
NigeriaX
RomaniaX
SpainX
TanzaniaX
sundarakumar
Specialist II
Specialist II

Hi,

PFA.

-Sundar

maxgro
MVP
MVP

or if you prefere in script:

I've added a table (bold) at your data

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='€ #.##0,00;-€ #.##0,00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='MM/DD/YYYY';

SET TimestampFormat='MM/DD/YYYY hh:mm:ss[.fff]';

SET MonthNames='gen;feb;mar;apr;mag;giu;lug;ago;set;ott;nov;dic';

SET DayNames='lun;mar;mer;gio;ven;sab;dom';

DIRECTORY;

Source:

LOAD @1 as Country,

     date(date#(left(@2, 10)))  as Date,

     @3 as Filed

FROM

[http://community.qlik.com/thread/108296]

(html, codepage is 1252, no labels, table is @1);

SourceByCountry:

LOAD

  Country,

  if(count(distinct Date)=1 and Min(Date) = '11/30/2013', 1, 0) as [Flag  11/12]

Resident

  Source

Group By Country;

Not applicable
Author

Thank you so much for your help.

Jasmine

Not applicable
Author

Hi Massimo,

Much appreciate your detailed explaination, it is very helpful.

Jasmine