Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Make Date

Hi,

Please help me with the following task:

File name is 032014.

I have Data as :

Name,

     [1] as [01],

     [2] as [02],

     [3] as [03],

     [4] as [04],

     [5] as [05],

     [6] as [06],

     [7] as [07],

     [8] as [08],

     [9] as [09],

     [10],

     [11],

     [12],

     [13],

     [14],

     [15],

     [16],

     [17],

     [18],

     [19],

     [20],

     [21],

     [22],

     [23],

     [24],

     [25],

     [26],

     [27],

     [28],

     [29],

     [30],

     [31]

Note: Day pick from top header

  Month&year pick from filename

And my Requirement is :

In a straight table :Max(Date),Name, Value(Corresponding value according to the Max (Date). 

For example:

DateNameValue
9-Mar-2014A400
9-Mar-2014B401
9-Mar-2014C402
9-Mar-2014D403
9-Mar-2014F404

Thanks

Ankit

17 Replies
Not applicable
Author

Name12345678910111213141516171819202122232425262728293031
A102030100121131200300400142434104125135204304404132333103124134203303403122232102
B11213110112213220130140112313320230240210412513520430440413233310312430100121131200300
C122232102123133202302402102030100121131321021231332023024021424341041251352042030
D132333103124134203303403122232102123133122132201301401123125135204304404133122132201301
F142434104125135204304404102030100121131331031241342033034031041251352043044041323202
jagan
Luminary Alumni
Luminary Alumni

Hi,

Did you tried the script in my previous  reply?

Regards.

jagan.

Not applicable
Author

Hi Jagan,

Yes, I have tried your script and its not showing the correct filedate and showing sum(values).

My requirement is now changed,

Please help me with that:

I want to show

Name     Value   Max(Date)

and the value to be corresponding to the Max(Date)

eg: A     400    31-03-2014.

CELAMBARASAN
Partner - Champion
Partner - Champion

Dimensions: Name, Value

Expression: Only({<Date={'$(=Date(Max(Date)))'}>} Date)

jagan
Luminary Alumni
Luminary Alumni

Hi,

Can you attach the sample file and expected output.

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

Can't attach the file however will try to explain what is data and requirement.

Filename is 032014

Below is the Data:

Name12345678910111213141516171819202122232425262728293031
A102030100121131200300400142434104125135204304404132333103124134203303403122232102
B11213110112213220130140112313320230240210412513520430440413233310312430100121131200300
C122232102123133202302402102030100121131321021231332023024021424341041251352042030
D132333103124134203303403122232102123133122132201301401123125135204304404133122132201301
F142434104125135204304404102030100121131331031241342033034031041251352043044041323202

Note:Day pick from top header
Month&year pick from filename

Output required is :

DateNameValue(According to MAX(Date)
Max dateAMAX Date Value
Max dateBMAX Date Value
Max dateCMAX Date Value
Max dateDMAX Date Value
Max dateFMAX Date Value

Thanks for being so patient.

Ankit

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.

Script used in file

Tab1:

CrossTable(Day, Value, 2)

LOAD

  FileName() AS FileName,

Name,

    [1],

    [2],

    [3],

    [4],

    [5],

    [6],

    [7],

    [8],

    [9],

    [10],

    [11],

    [12],

    [13],

    [14],

    [15],

    [16],

    [17],

    [18],

    [19],

    [20],

    [21],

    [22],

    [23],

    [24],

    [25],

    [26],

    [27],

    [28],

    [29],

    [30],

    [31]

FROM

[032014.xlsx]

(ooxml, embedded labels, table is Sheet1);

Data:

LOAD

*,

Date(Date#(Mid(FileName, 3,4) & '-'  & Num(Left(FileName, 2)) & '-'  & Day, 'YYYY-M-D')) as Date

RESIDENT Tab1;

DROP TABLE Tab1;

Dimensions : Name, Date

Expression : =Sum({<Date={"$(=Date(Max(Date)))"}>}Value)

or =Aggr(If(Max(TOTAL<Name> Date) = Date, Sum(Value)), Name, Date)

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

Finally it worked and thanks a lot for helping.

Thanks

Ankit