Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Loading only the maximum value to every cell in a column

Dear community,

I have a case where I need to create a column the maximum value that is in another column.

The data looks like this:

DateData
01.01.2015100
01.01.2015200
150
01.01.2016100
120
01.01.2018130
140
01.01.2015170

The goal is to get a column with the max date in every cell:

DateData
01.01.2018100
01.01.2018200
01.01.2018150
01.01.2018100
01.01.2018120
01.01.2018130
01.01.2018140
01.01.2018170

I have a big data set and multiple sheets, so I need to make the operation nice and easy.

Thank you guys!

4 Replies
MVP
MVP

Re: Loading only the maximum value to every cell in a column

temp:

Load

          max(Date) as MaxDate

From <>;

Let vMaxDate=Date(Peek('MaxDate'));

Drop table temp;

final:

Load

          '$(vMaxDate)' as Date,

          Data

From <>;

Re: Loading only the maximum value to every cell in a column

Hi

try some thing like this

Table1:

LOAD Date(Date#(Date,'DD.MM.YYYY')) as Date, Data INLINE [

    Date, Data

    01.01.2015, 100

    01.01.2015, 200

    ,150

    01.01.2016, 100

    ,120

    01.01.2018, 130

    ,140

    01.01.2015, 170

];

Join(Table1)

LOAD Date(max(Date)) as MaxDate Resident Table1;

Edit:

Use, MaxDate as Dimension.

Re: Loading only the maximum value to every cell in a column

Please see the attached one

Not applicable

Re: Loading only the maximum value to every cell in a column

Please find the attached QVW file.I have done it at script level.

Community Browser