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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
wenkew186
Creator
Creator

Get the before column value

Hi all,

There's a question with get before column value.

I have 2 dates, one is normal SNP date has mapping data. one is special date no data mapping.

I want get the expression1 value use to parameter for expression2. is that possible? how to do it?

see sample file.

1 Solution

Accepted Solutions
sunny_talwar

Check this out:

Sum(Aggr(If([SNP Date]= Max(TOTAL <Country> [Cut off Date]), Value), Country, [SNP Date]))

Added another Country in the script:

load * inline [

Country,        SNP Date,          Cut off Date,       Value

USA,     2016-03-01,                        ,21

USA,  2016-03-02,                           ,22

USA,   2016-03-03,                          ,23

USA,  2016-03-04,                           ,24

USA,                         ,2016-03-03,

USA,                         ,2016-03-02,

Canada,     2016-03-01,                        ,31

Canada,  2016-03-02,                           ,32

Canada,   2016-03-03,                          ,33

Canada,  2016-03-04,                           ,34

Canada,                         ,2016-03-02,

];

Output:

Capture.PNG

View solution in original post

6 Replies
sunny_talwar

May be use this expression:

sum({<[SNP Date]={"$(=date(max([Cut off Date]),'YYYY-MM-DD'))"}>} Value)

wenkew186
Creator
Creator
Author

thank you Sunny,

I add 2 country for data source, but looks the date not by Country, the expression2 just get the total max date of cut off Date, is there any way?

sunny_talwar

Check this out:

Sum(Aggr(If([SNP Date]= Max(TOTAL <Country> [Cut off Date]), Value), Country, [SNP Date]))

Added another Country in the script:

load * inline [

Country,        SNP Date,          Cut off Date,       Value

USA,     2016-03-01,                        ,21

USA,  2016-03-02,                           ,22

USA,   2016-03-03,                          ,23

USA,  2016-03-04,                           ,24

USA,                         ,2016-03-03,

USA,                         ,2016-03-02,

Canada,     2016-03-01,                        ,31

Canada,  2016-03-02,                           ,32

Canada,   2016-03-03,                          ,33

Canada,  2016-03-04,                           ,34

Canada,                         ,2016-03-02,

];

Output:

Capture.PNG

wenkew186
Creator
Creator
Author

se the new sample

sunny_talwar

Kevin Wen wrote:

se the new sample

Not sure what you mean

wenkew186
Creator
Creator
Author

It works for me! Great help Sunny, thank you very much!