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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
joshrussin
Creator III
Creator III

Creating a new table with dates

I am wanting to create a table within Qlik, something like this.

chart.PNG

With data that looks something like this.

chart1.PNG

For each area, I want it to show Processed and WIP. Any suggestions?

3 Replies
aarkay29
Specialist
Specialist

manas_bn
Creator
Creator

Take a look at this: The Generic Load

Table:

//Load ID,Date,Sum(Sales) as AggrSales;

LOAD * Inline

[ID,Date,Sales

1,1/1/2017,1

1,1/1/2017,1

1,1/2/2017,1

1,1/2/2017,1

1,1/3/2017,1

2,1/1/2017,1

2,1/2/2017,1

2,1/2/2017,1];

//Sales Aggregate

AggrTable:

load ID,Date,Sum(Sales) as AggrSales Resident Table

group by ID,Date;

//Generic load ID,Date,Sales Resident Table;

drop Table Table;

Generic load ID,Date,AggrSales Resident AggrTable;

But this method will create multiple tables for each date which you may want to combine.

Not sure if there are other ways to do this.

Cheers!

manas_bn
Creator
Creator

This piece of code worked in combining all the different generic tables into one.

FOR i = NoOfTables()-1 to 0 STEP -1

  LET vTable=TableName($(i));

  IF WildMatch('$(vTable)', 'AggrTable-1.*') THEN

    LEFT JOIN (AggrTable) LOAD * RESIDENT    [$(vTable)];

    DROP TABLE  [$(vTable)];

  ENDIF

NEXT i

But note that in the front end, you will have to figure out a way for dynamically changing columns whenever a new date is added to the data set.

genericload.PNG